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

My Daily Reward Script Is Only Working For The First 3 People That Join The Game?

My Daily Reward Script Is Only Working For The First 3 People That Join The Game, It Consists Of A Touch Part That Gives A Small Popup Gui On Your Screen. Another Problem It Has Is That It Gives You 2000$ Instead Of 1000$, Though I Have Adapted To This Change.

currency = "Money"	
amnt = 1000			
debounce = false		

	function onTouch(hit)
		if hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == false then
			if game.Players:findFirstChild(hit.Parent.Name) ~= nil then
			ThisPlayer = game.Players:findFirstChild(hit.Parent.Name)
			ThisPlayer.leaderstats:findFirstChild(currency).Value = ThisPlayer.leaderstats:findFirstChild(currency).Value + amnt
			script.Parent.Transparency = 1
			script.Parent.CanCollide = false
			debounce = true
			wait(86400)		-- Respawn time for the cash giver
			script.Parent.Transparency = 0
			script.Parent.CanCollide = true
			debounce = false
			end
		end
	end


script.Parent.Touched:connect(onTouch)

1 answer

✓ Accepted answer

Just do a PlayerAdded event:


game.Players.PlayerAdded:Connect(function(playerName)
	-- blah blah blah
end)

1 comment

0

I Already Tried That And It Was Very Buggy

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