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)
game:getservice('players').localplayer.characteradded:Connect(Function(char)
repeat wait() until char.Parent == workspace
--players character has spawned and is on pad
end)
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)
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'
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)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.