Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont this script work Im trying to make it check when the player is sitting on the chair?

Its not working

local clipboardChildren = game.Workspace.ClipBoard:GetChildren()

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid")then
		local human = hit.Parent:FindFirstChild("Humanoid")
		if human.Sit == true then 
		print("Human Sitting")
			for i,object in pairs(clipboardChildren) do
				object.Transparency = 0
			end
		else
			print("Human Not Sitting")
			for i,object in pairs(clipboardChildren) do
				object.Transparency = 1
			end
		end
	end
end)

1 answer

✓ Accepted answer

Hello there! I put together this code that should work for detecting players sitting in seats

local Players = game:GetService("Player")

local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

Character:WaitForChild("Humanoid").Seated:Connect(function(IsSeated, Seat)
    if not IsSeated or Seat.Name ~= "seat name" then 
          --Code here
    end
end)

Hope this helped!

4 comments

0

Thanks

0

How do I check if the player got up then?

0

why did you change the script, instead of helping him with the question?

0

you also didn't even explain it

This discussion is preserved as it was. New answers, comments, and votes are closed.