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

Help! I made two scripts and both are not working. Can I have help please?

I made two scripts that do the same thing. They both do not work. I only need one working.

Script 1:

Button = script.Parent.Frame.TextButton
Player = game.Players.LocalPlayer
Button.MouseButton1Down:connect(function()
	Player.leaderstats.Money.Value = Player.leaderstats.Clicks.Value + 1
end)

I made a other script that was to do the same thing and its a localscript here it is

Script 2 (Localscript):

repeat
	wait()
until game.Players.LocalPlayer:FindFirstChild("stats")~=nil

function addCash()
	game.Players.LocalPlayer.stats.cash.Value=game.Players.LocalPlayer.stats.Clicks.Value+1
end

script.Parent.MouseButton1Down:connect(addCash)

You will wanna click view source to view the full script

1 answer

--The Fixed Script--


Button = script.Parent.Frame.TextButton 


Button.MouseButton1Click:Connect(function(hit) 


    local player = game.Players:GetPlayerFromCharacter(hit.Parent)


    Player.leaderstats.Money.Value = player.leaderstats.Clicks.Value + 1

end)


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