I used an event, PlayerAdded, to detect when a player joins the game, but it won't work. Why?
I've got this script inside of the part:
01 | local players = game:GetService( "Players" ) |
02 | local ServerStorage = game:GetService( "ServerStorage" ) |
04 | players.PlayerAdded:Connect( function (plr) |
08 | local money = plr.leaderstats:WaitForChild( "Money" ) |
10 | plr.CharacterAdded:Wait() |
12 | if script.Parent.Parent = = game.Workspace then |
16 | money.Value = money.Value + 75 |
So what it does basically - the part is in ServerStorage and when player logs in if they have gamepass part is in workspace so if its in workspace i want to give money every 7 seconds but it doesnt work.
also when player joins "g" doesnt get printed so yeah
I thought it's maybe because scripts dont work in ServerStorage perhaps, but idk, pls help