A annoying script bug (I presume)

Im trying to make a custom sit tool, 1st time didn’t work, 2nd didn’t work (followed a tut), 3rd I copied word to word and tool to script a sit tool that i took from the toolbox (Wich I do not want to risk with)
and for some magical reason it still doesn’t work. I need help or advice on how to prevent myself from runnning into these kind of problems, because I as of now think this is a Studio glitch or something worse

My script if someone needs it raw (also the Toolbox one, but I think you already know that they both are the same)

local LocalPlayer = game.Players.LocalPlayer
local tool = script.Parent

tool.Equipped:Connect(function()
	LocalPlayer.Character.Humanoid.Sit = true
end)

tool.Unequipped:Connect(function()
	LocalPlayer.Character.Humanoid.Sit = false
end)

Try this

local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local tool = script.Parent

tool.Equipped:Connect(function()
	Character:WaitForChild("Humanoid").Sit = true
end)

tool.Unequipped:Connect(function()
	Character:WaitForChild("Humanoid").Sit = false
end)
1 Like

While your script also works turns out i didn’t have RequireHanlde = false and CanBeDropped false and that seems to have been the problem, thanks for helping anyway.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.