脚本仅在Studio

时间:2018-04-22 12:45:11

标签: lua roblox

//编辑:是的我添加了第二个参数GPE,如果不是gpe则返回结束以防有人挑选不必要的细节

另一个问题是它很长但是如果你看了它并看到了错误,请告诉我。我还把它作为Startpack中的LocalScript。

local uis = game:GetService("UserInputService")
local torso = script.Parent.Parent.Character.Torso or script.Parent.Parent.Character.UpperTorso
local TweenService = game:GetService("TweenService")
local db = true

function move(x)
local velocity = Instance.new("BodyVelocity")
velocity.Velocity = torso.CFrame.lookVector*50
velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
velocity.Parent = x
end

uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.R and db then
db = false

local part = game:GetService("ReplicatedStorage").Union:Clone()
part.CFrame = torso.CFrame + torso.CFrame.lookVector*10
part.Parent = game.Workspace

local effect = game.ReplicatedStorage.Waterfall:Clone()
effect.CFrame = part.CFrame

local light = game:GetService("ReplicatedStorage").PointLight:Clone()
light.Parent = part

local weld = Instance.new("ManualWeld")
weld.Part0 = part
weld.Part1 = effect
weld.Parent = part
effect.Parent = part

local goal3 = {}
goal3.Size = Vector3.new(120,70,70)

local goal4 = {}
goal4.Size = goal3.Size

local tweenInfo = TweenInfo.new(2)

local tween3 = TweenService:Create(part, tweenInfo, goal3)
local tween4 = TweenService:Create(effect,tweenInfo, goal4)

tween3:Play(); tween4:Play()

game.Lighting.Blur.Enabled = true; game.Lighting.ColorCorrection.Enabled = true

move(part)
part.Anchored = false
effect.Anchored = false
move(effect)

local goal = {}
goal.Size = Vector3.new(30,7,7)
goal.Transparency = 0.4

local goal2 = {}
goal2.Size = goal.Size

local tweenInfo = TweenInfo.new(3)

local tween = TweenService:Create(part, tweenInfo, goal)
local tween2 = TweenService:Create(effect,tweenInfo, goal2)

tween:Play(); tween2:Play()

game:GetService("Debris"):AddItem(part,2)
game:GetService("Debris"):AddItem(effect,2)
wait(.5)
game.Lighting.Blur.Enabled = false; game.Lighting.ColorCorrection.Enabled = false
db = true

end
end)

事情很简单,当我发布游戏并播放它时它不起作用,但它只适用于Roblox Studio。 它尚未启用过滤,但仍无效。我完全不知道。

1 个答案:

答案 0 :(得分:0)

修正了它大声笑我只是将localscript从starterpack移动到startercharacter:D