Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Something's wrong with the gui that I click to give me money (Help)?

Asked by 5 years ago

Hi, I have a datastore script that saves likes its suppose to, but when I click the gui that gives me money and leave it doesnt work. I tried going on console and giving myself money and I left, it worked. I think somethings wrong with the gui but I dont know what. It shows its changing the money but it doesnt save it. Heres the script

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()

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

end)
0
Well datastores dont work like before, so i suppose for your problem, u should use the datastore2 tutorial in GUI Form, I can help if you want. DEVLogos 8 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

You cannot alter an instance via local script if your game has FilteringEnabled on, which it should. Instead, you will have to approach the problem with a RemoteEvent. Check out this page on the Roblox documentation for examples of how to use remote events.

0
Thanks, but I cant accept your answer. zandefear4 90 — 5y
0
Nevermind, now it's letting me. zandefear4 90 — 4y
Ad

Answer this question