The GUI is supposed to add one point each time it's clicked but It's not working. I think it won't work because I'm trying to require something from the ServerStorage in a LocalScript. Is there any work-around for this?
local DataStore2 = require(game.ServerScriptService.StatsDataStore2:WaitForChild("MainModule"))
local Player = game.Players.LocalPlayer
function onclick()
local PointsStore = DataStore2("Points", Player)
PointsStore:Increment(1)
end
script.Parent.MouseButton1Click:connect(onclick)

4 comments
Also, datastores cant be used from LocalScripts
So basically this will never work and there's no way around it?
There is a way around it. Check this out (https://scriptinghelpers.org/guides/server-client-relationship-in-roblox) for more information
https://scriptinghelpers.org/guides/how-to-use-remoteevents-properly (this too)