Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Movement is only happening in studio?

Asked by 8 years ago
wait()

local function motor(second, parent)
    local x = Instance.new("Motor", parent)
    x.DesiredAngle = 100000000000000000 
    x.MaxVelocity = 1 
    x.Part0 = script.Parent.Union
    x.Part1 = second
end

script.Parent.Union.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild'Humanoid' then
        hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 30
    end
end)

motor(script.Parent.FakeHandle, script.Parent)
motor(script.Parent.Blades, script.Parent)

local targets = game:GetService'Players':GetChildren()
local choosetarget = targets[math.random(1, #targets)]

while wait() do
    local y = Instance.new("BodyPosition", script.Parent.Union)
    y.Position = choosetarget.Character.Torso.Position
    wait()
    y:Destroy()
end

bad argument #2 to random(interval is empty) -- Line 21

Answer this question