Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help with player added?

I have a script that uses the PlayerAdded event to work but it doesn't work and i have seen some other people say that it doesn't work for them either. Any fixes? It was working before But it just stopped working a couple hours ago...

game.Players.PlayerAdded:connect(function(plr)
	local PlayerValues = Instance.new("Folder", plr)
	PlayerValues.Name = "PlayerValues"
	local PlayerPlaying = Instance.new("BoolValue", PlayerValues)
	PlayerPlaying.Name = "Playing"
	local AFK = Instance.new("BoolValue", PlayerValues)
	AFK.Name = "AFK"
	local Money = Instance.new("IntValue", PlayerValues)
	Money.Name = "Money"
	Money.Value = ds1:GetAsync(plr.UserId) or 0
	ds1:SetAsync(plr.UserId, Money.Value)
	Money.Changed:connect(function()
		print("Saving Data")
		ds1:SetAsync(plr.UserId, Money.Value)
		print(plr.Name.."'s Data of "..Money.Value..""..Money.Name.." has been saved!")
		end)
end)

5 comments

0

can you... Um post the script so we can help?

0

PlayerAdded doesn't fire when the player joins offline (i.e. play solo in studio) if that's how you're testing it.

0

Heh, did you use SpooksHD's tutorial?

0

It also might not work if the person is the first in the server.

0

We all need help. Some form of help... mostly mental help. The cure? Rocket League.

2 answers

✓ Accepted answer

Actually there are rumors that ROBLOX actually broke the PlayerAdded event.

game.Players.PlayerAdded:connect(function(player)
     print(player.UserId)
end)

I have an event that seems to semi work when a player is added, let me test to ensure.

This seems to work fine.

This discussion is preserved as it was. New answers, comments, and votes are closed.