Getting the humanoid

@shinzos_MT maybe try something along these lines.

1-Use CollectionService to tag objects
2-Use a event to check when player sits
3-Check to see if the seat is in a object with the tag

Ok,


game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		humanoid.Seated:Connect(function(seated,seatPart)
			if seated then
				print("player sat down on "..seatPart:GetFullName())
			end
		end)
	end)
end)

You can add conditions before even doing the seated event.

Is this like a PVP game? Are they line being teleported into a ring? Any information on how the game works? If they are teleported/moved into a area, you can also get the humanoid from that script

This is how I’d do I

--local script
task.wait()
local RS = game:GetService("ReplicatedStorage")
local GetHumanoid = RS:WaitForChild("GetHumanoid") --Remote Event

GetHumanoid:FireServer()

--server script
local RS = game:GetService("ReplicatedStorage")
local GetHumanoid = RS:WaitForChild("GetHumanoid") --remote event

GetHumanoid.OnServerEvent:Connect(function(player)
	local Character = player.Character or player.CharacterAdded:Wait()
	local Humanoid = Character:WaitForChild("Humanoid")
	print("done") print(Character.Name)
end)

bro this is how I get humanoid in other scenarios

BTW, he said it’s a server script.

It would still work even if its a server script
have you tried it?

this would also cause an issue with the lobby players, as they cannot sit.

Oops sorry, should have read the script lol (I just read local script). The first thing I suggested (first reply) was remote event so.

kind of a pvp game, but it’s in a simple obby style and random events happen every few seconds

no but ill probably try using teams if i cant find any other way

i tried your method and nothing happened. I added the remote event, the local script and a different server script to test it. (both scripts are in the workspace)

Bro
a local script can’t work in the workspace it’s connected to the player so you keep it in here

image

Try my script again and I see what you’re doing know so add this

--local script
task.wait()
local RS = game:GetService("ReplicatedStorage")
local GetHumanoid = RS:WaitForChild("GetHumanoid") --Remote Event

GetHumanoid:FireServer()

--server script
local RS = game:GetService("ReplicatedStorage")
local GetHumanoid = RS:WaitForChild("GetHumanoid") --remote event

GetHumanoid.OnServerEvent:Connect(function(player)
	local Character = player.Character or player.CharacterAdded:Wait()
	local Humanoid = Character:WaitForChild("Humanoid")
	print(Humanoid:GetState())
	print("done") print(Character.Name)
end)

image
it works fine so if you made some bad changes then it not my fault

1 Like

yeah my bad on putting a local script in the workspace brain is hella fried, thank you though

You’re welcome but did it work?

yeah, thank you again been trying for awhile lol

1 Like