Hello! I’m trying to make it so it gives the player my in-game currency of robux, every 10 seconds when their touching the player or players then, it will give the local player or players ( the player or players who are touching the Invisible block with no collision ) then gives them 5 robux every 20 secs, the script doesnt work tho here’s what came inside the output
The Output
11:08:21.605 The Roblox Economy auto-recovery file was created - Studio - C:/Users/mrtix/OneDrive/Documents/ROBLOX/AutoSaves
11:08:22.955 Workspace.BuyColaButton1.BuyerHandle:60: Expected 'end' (to close 'then' at line 8), got <eof>; did you forget to close 'then' at line 39? - Studio - BuyerHandle:60
11:08:35.463 Workspace.MoneyMakingZoneBloxy,BloxyCorners.RobuxHandler:3: attempt to index nil with 'leaderstats' - Server - RobuxHandler:3
11:08:35.464 Stack Begin - Studio
11:08:35.464 Script 'Workspace.MoneyMakingZoneBloxy,BloxyCorners.RobuxHandler', Line 3 - Studio - RobuxHandler:3
11:08:35.464 Stack End - Studio
11:08:37.772 0.5, 0.5 - Server
11:08:38.078 0.5, 0.5 - Client
The Script
if game.Workspace["MoneyMakingZoneBloxy,BloxyCorners"].Touched then
wait(20)
game.Players.LocalPlayer.leaderstats.Robux.Value = game.Players.LocalPlayer.leaderstats.Robux.Value + 5
end
if game.Workspace["MoneyMakingZoneBloxy,BloxyCorners"].Touched then
wait(10)
game.Players.LocalPlayer:WaitForChild('leaderstats').Robux.Value = game.Players.LocalPlayer:WaitForChild('leaderstats').Robux.Value + 5
end
I’m not sure how to help with this, sorry, however - I would not recommend changing leaderstats on the Client, this means that the server cannot see your Robux Value, only the Client.
If you’re handelling your economy on the client, this is a large open gate for Exploiters to give themself Robux by simply running game.Players.LocalPlayer.leaderstats.Robux.Value = game.Players.LocalPlayer.leaderstats.Robux.Value + 1000000000000 on their Executor.
12:23:03.491 Workspace.MoneyMakingZoneBloxy,BloxyCorners.RobuxHandler:3: attempt to index nil with 'WaitForChild' - Server - RobuxHandler:3
12:23:03.492 Stack Begin - Studio
12:23:03.492 Script 'Workspace.MoneyMakingZoneBloxy,BloxyCorners.RobuxHandler', Line 3 - Studio - RobuxHandler:3
12:23:03.492 Stack End - Studio
12:23:06.488 0.5, 0.5 - Server
12:23:06.757 0.5, 0.5 - Client