I’ve been trying to fix the current issue that I’m having, which is, when the user resets/dies, the weapon frame appears. Normally, when the user is in the civillians team, the weapons frame shouldn’t be appearing, however it does after user resets himself or gets killed. Any ideas on how to fix this?
Solutions I tried:
-Making a localscript inside StarterCharacterScripts which is:
‘’‘game.Players.CharacterAdded:Connect(function(playermodel)
playermodel:WaitForChild(“Humanoid”).Died:Connect(function()
game.ReplicatedStorage.Events.Client:FireClient(playermodel, “Civ”)
end)
end)’’
-Pasting the script above to my serverscript
-Removing the “ResetOnSpawn” option at the GUI, which was a failure
-A few more approaches
I want the GUI to still be disabled when character resets himself/herself or dies.
I have a script that disables the GUI automatically when user joins for the first time and changes his/her team to “Civillians”
CharacterAdded isn’t part of the Players service. I think what you meant to put there was PlayerAdded. Once you have the player, you can connect the CharacterAdded event to them. I hope the example I provided below can help.
Server script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
-- The rest of your code goes here
end)
end)