Weapons not giving to player if in other team


(local script in starterchar)


(script in severscriptservice)

when ever my team picker randomizer picks shooter i dont get the weapons and i get no prints…

1 Like

Your LocalScript is likely running before the player’s team gets chosen.

Instead of using a LocalScript to ask the server to give them the tool, you can handle all of this from the server by checking the player team from there.

For example:

-- Script in ServerScriptService

game.Players.PlayerAdded:Connect(function(player)
   player:GetPropertyChangedSignal("Team"):Connect(function()
            if player.Team == game.Teams.Shooter then
                     --Give tool
            end
   end)

end)

1 Like

o…ok. so the script did work but what does getpropertychangedsignal mean?

It’s a way to detect when a specific property of an instance changes as long it’s not physics related. Very useful, I’d recommend reading about it.

1 Like

ah thank you i will try using it in the future!

1 Like