Check when a player uses a spawn pad

Noob scripter here.
Is there a way to check when a player uses a spawn pad. I wanted to create an effect on the pad for every time someone spawns.

What type of effect do you want to create? Also, do you only want it to happen when the Player first spawns / first joins the game?

For every time they spawn within the game
Just a small animation that happens on the pad

I assume you would want to do that on a Server script so here’s a snippet

game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
-- Add your “effect” code here
end)
end)

EDIT: Here’s some proof

By the way, this fires every time the character is re-added (basically after the Humanoid.Died event fires)

1 Like
game:getservice('players').localplayer.characteradded:Connect(Function(char)

repeat wait() until char.Parent == workspace

--players character has spawned and is on pad

end)
2 Likes

Got it to work but is there a way to make it detect which spawn pad you use?
Don’t need all spawn pads triggering at the same time

create a script inside the spawnpad and inside there put this code:

script.parent.Touched:Connect(Function(part)

if part.Parent then

if part.Parent:FindFirstChild("Humanoid") then
-- trigger the effect or whaterver



end

end

end)
1 Like

yeah sorry im dumb lol

I put in exactly what you put in but got this
Workspace.Model.SpawnPad.SpawnLocation.Script:14: Expected <eof>, got 'end'
image

script.parent.Touched:Connect(Function(part)

if part.Parent then
	if part.Parent:FindFirstChild("Humanoid") then
--Changed
		script.Parent.Sparkles.Enabled = true
		wait (10)
		script.Parent.Sparkles.Enabled = false



		end

	end

	end)

I mistyped ‘function’ for ‘Function’ soz was writing without the studio

script.parent.Touched:Connect(function(part)

	if part.Parent then
		if part.Parent:FindFirstChild("Humanoid") then
			--Changed
			script.Parent.Sparkles.Enabled = true
			wait (10)
			script.Parent.Sparkles.Enabled = false



		end

	end

	end)
2 Likes

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