I have been struggling with this for a while now, looked around and found no answers. I'm new to this but could find nothing of any help after several hours.
Workspace: Script named RemoteStats, RemoteEvent called ChangeStats inside
Level = game.ServerStorage.StatFile.player.statnumbers.Level LevelValue = game.ServerStorage.StatFile.player.statnumbers.Level.Value script.ChangeStats.OnServerEvent:connect(function(player) Level.Value = Level.Value + 1 print(LevelValue) end)
Inside a GUI and localscript
script.Parent.MouseButton1Click:connect(function(player) game.Workspace.RemoteStats.ChangeStats:FireServer() end)
Try using this:
Localscript:
script.Parent.MouseButton1Click:connect(function() game.Workspace.RemoteStats.ChangeStats:FireServer(script.Parent.Text) end)
ServerScript
Level = game.ServerStorage.StatFile.player.statnumbers.Level LevelValue = game.ServerStorage.StatFile.player.statnumbers.Level.Value script.ChangeStats.OnServerEvent:connect(function(player, text) Level.Value = Level.Value + 1 print(LevelValue) end)