Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hat only given on joining, not when they respawn! Why?

Asked by 9 years ago

Hey guys,

I have a gamepass that will give the buyer a hat, but I don't know how to give it to them every time they respawn!

This script here gives it to them on joining only, can someone change it to each time they respawn?

game.Players.PlayerAdded:connect(function(player)
newPlayer.Respawned:connect(function(respawn)
repeat wait() until player.Character
if Game:GetService("GamePassService"):PlayerHasPass(player, passid) then
hat = game.ServerStorage["Hat"]
hat:clone().Parent = player.Character
end
end)
end)

Cheers in advanced,

Michael

Answer this question