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

I need help on a tool where you click for cash? (Read desc)

Hi Happy Easter today I need help on a tool where when clicked on it gives you cash from the leaderstats. I tried this script and someone has even helped me but sadly it did not work. So do you think you can correct me? Also I need more than one tool so I need it to only be a script in the tool.

local remote = game.ReplicatedStorage.Give
remote.OnServerEvent:Connect(function(Player) local plr = Player plr.leaderstats.Sips.Value = plr.leaderstats.Sips.Value +1 end)

@ thatwalmartman - Helped but did not work thank you though.

1 answer

This should work.

Local Script:

local Tool = script.Parent
local RemoteEvent = game.ReplicatedStorage.Give

Tool.Activated:Connect(function()

	RemoteEvent:FireServer()

end)

Server Script:

game.ReplicatedStorage.Give.OnServerEvent:Connect(function(player)

	player.leaderstats:WaitForChild("Sips").Value = player.leaderstats:WaitForChild("Sips").Value + 1

end)

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