Server script inside of serverscriptservice:
game.Players.PlayerAdded:Connect(function(plr) game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function() if plr.leaderstats.Memory.Value > 100 then plr.leaderstats.Memory.Value = plr.leaderstats.Memory.Value - 100 plr.leaderstats.Deletes.Value = plr.leaderstats.Deletes.Value + 10 end end) end)
Local script in a textbutton:
script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.RemoteEvent:FireServer() end)
Output: No errors
What have I done wrong? (Yes, there is a remoteevent in replicatedstorage.)