Code:
function Click()
game.Workspace.Player.Name.Tors.Waist.Seat.Disabled = true
wait(1)
game.Workspace.Player.Name.Tors.Waist.Seat.Disabled = false
end
script.Parent.MouseButton1Down:connect(Click)
Code:
function Click()
game.Workspace.Player.Name.Tors.Waist.Seat.Disabled = true
wait(1)
game.Workspace.Player.Name.Tors.Waist.Seat.Disabled = false
end
script.Parent.MouseButton1Down:connect(Click)
Improvements
Use Connect since connect is deprecated
Use Activated since it will work for all devices and not just computers
Use WaitForChild() to make sure an instance exists before using it
Issues
When you use Player.Name the way you have it written is that the "Tors" is parented under the player's Name property, which is impossible
Assuming you are attempting to locate the player in the workspace, use the player's Character instance instead
If this is in a GuiObject, the script should be a LocalScript and not a ServerScript
Revised Local Script
local player = game:GetService("Players").LocalPlayer
local button = script.Parent
button.Activated:Connect(function()
local char = player.Character
local seat = char:WaitForChild("Tors"):WaitForChild("Waist"):WaitForChild("Seat")
seat.Disabled = true
wait(1)
seat.Disabled = false
end)
Thanks! Sorry this is my first script ever
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
help pls...