#How do I check for server events in local scripts?

1 messages · Page 1 of 1 (latest)

brisk spruce
#

local player = game.Players.LocalPlayer

local PlayerMaxHealth = 100

local AddMh = game.ReplicatedStorage.AddMH

AddMh.OnServerEvent:Connect(function(player)
PlayerMaxHealth += 5
player.Humanoid.MaxHealth = PlayerMaxHealth
end)

This is a small snippet of my code, And when i run it it tells me i cant check for servr events on a script not in the server script service. I assume this has to do with my script being a localscript. Can anyone help?

polar olive
#

Localscript is .OnClientEvent and server is .OnServerEvent