I want to make a seat exclusively for one player, if another player sits on it then they are forced to stand up (basically they can't sit down).
This is my script:
local seat = script.Parent
seat.ChildAdded:connect(function( newChild )
if newChild:IsA("Weld") then
if newChild.Part1.Name == "HumanoidRootPart" then
local player = game.Players:GetPlayerFromCharacter(newChild.Part1.Parent)
if (player) then
if not player.Name == "iiPizzaCraver" then
player.Humanoid.Jump = true
else
--let them sit
end
end
end
end
end)
There are no errors in the output. It just doesn't work at all.

14 comments
try changing the "if not player.Name == "iiPizzaCraver" then statement to "if player.Name ~= "iiPizzaCraver" then"
beacuse it seems like that if statement is testing to see if there's a Instance named player.Name instead of testing to see if the value equates to "iiPizzaCraver"
Okay i will try it
Humanoid is not a vlid member of player
What have you defined player as
local player = game.Players:GetPlayerFromCharacter(newChild.Part1.Parent)
how did you implement the if statement on line 7
the way you told me to do it
Try putting a bunch of print statements that print the values of the defined variables. That works like 99% of the time
idk how to do that
an example would be like print(player.Name) to see what the game's getting as the playername
Oh ok
lmk what you get as output
my name