It needs to be a remote event or else the filtering will block it.
script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.ExpUp:FireServer() end)
game.Players.PlayerAdded:Connect(function(player) game.ReplicatedStorage.ExpUp.OnServerEvent:Connect(function() local exp = player:WaitForChild("Leaderstats")["Exp"] local mana = player:WaitForChild("Mana") local manac = player:WaitForChild("Manac") if mana.Value >= 5 then exp.Value = exp.Value + 20 mana.Value = mana.Value - 10 end end) end)
Ok, so the problem here is that you increase the EXP and mana of the player in the players.PlayerAdded event, this means that everyone in the game will get exp and mana instead of that one player. What you should add the EXP and mana to the player who clicks the button(ExpUp event). Also, you really shouldn't place the ExpUp event inside the player added event, just put it outside.
game.Players.PlayerAdded:Connect(function(player) - you were using this player --fires every time a player is added-- end) game.ReplicatedStorage.ExpUp.OnServerEvent:Connect(function(clickedplayer) -- use clicked player instead, they are sent instantly when fireserver is used in a localscript local exp = clickedplayer:WaitForChild("Leaderstats")["Exp"] local mana = clickedplayer:WaitForChild("Mana") local manac = clickedplayer:WaitForChild("Manac") if mana.Value >= 5 then exp.Value = exp.Value + 20 mana.Value = mana.Value - 10 end end)