Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
you need to check to see if the player has it before adding it
01 | local pad = script.Parent |
02 | local gui = game.ServerStorage.EditChar 1 |
03 | local function steppedOn(part) |
04 | local character = part.Parent |
05 | local player = game.Players:GetPlayerFromCharacter(character) |
07 | if not (player.PlayerGui:FindFirstChild( "EditChar1" )) then |
08 | local guiCopy = game.ServerStorage.EditChar 1 :Clone() |
09 | guiCopy.Parent = player.PlayerGui |
15 | pad.Touched:connect(steppedOn) |
basically what i added to the code was everytime that someone steps on the part and tries to get the gui i checked to see if the player had the gui in their playerGui folder already. If the player didnt have it then we added it to them so it is only added once