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

This script broke can someone please help me?

Asked by 10 years ago

So it is a sleep tool it suppose to make you sleep but it doesn't make you fall anymore really does nothing. Can someone please fix it?

Script:

gyro = Instance.new("BodyGyro")
gyro.maxTorque = Vector3.new(4e+004,0,0)
gyro.cframe = CFrame.fromAxisAngle(Vector3.new(0,0,1),math.pi/2)

function onButton1Down(mouse)

local player = game.Players.LocalPlayer
if player == nil then return end

if player.Character.Torso:findFirstChild("BodyGyro") ~= nil then
player.Character.Torso:findFirstChild("BodyGyro"):remove()
else
gyro:clone().Parent = player.Character.Torso
end

mouse.Icon = "rbxasset://textures\\ArrowCursor.png"

end

function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)

1 answer

Log in to vote
-1
Answered by 10 years ago

Maybe LocalPlayer is your error.

gyro = Instance.new("BodyGyro")
gyro.maxTorque = Vector3.new(4e+004,0,0)
gyro.cframe = CFrame.fromAxisAngle(Vector3.new(0,0,1),math.pi/2)

function onButton1Down(mouse)

local player = script.Parent.Parent.Parent
if player == nil then return end

if player.Character.Torso:findFirstChild("BodyGyro") ~= nil then
player.Character.Torso:findFirstChild("BodyGyro"):remove()
else
gyro:clone().Parent = player.Character.Torso
end

mouse.Icon = "rbxasset://textures\\ArrowCursor.png"

end

function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)

Ad

Answer this question