--[iLegimate]--
game.Players.PlayerAdded:connect(function(player)
if player.Name == "Player" then
player:WaitForChild("StarterGear")
local sc = game.ReplicatedStorage["HARD_DRIVE"].ScriptStorage.MapChoserApproval:Clone()
local sc2 = game.ReplicatedStorage["HARD_DRIVE"].ScriptStorage.MapChoserApproval2:Clone()
sc2.Parent = player.StarterGear
sc.Parent = player.Backpack
else
return nil
end
end)
So this works perfectly in studio..But for some reason when i test it in an actual game it wont work?
(MapChoserApproval 1 & 2 are scripts which clone a gui into the player's playergui) (My intention is to clone a gui into my playergui (Basically like a gear in startergear,But in PlayerGui)

5 comments
It's because of the if then statement on line 4. Unless someone named Player enters, your script will not run.
Um,Wait it has PlayerAdded event to it,So when a player joins it checks if the player's name is ilegimate,If it isnt it doesnt run
" if player.Name == "Player" then" That is 100% what line 4 says...
You don't need to check anything, the PlayerAdded event will only fire if an actual player connects to the server. Just remove the if statement and you'll be good to go.
And the return nil