the scripts are pretty self explanatory but the local does not print anything and the server doesn't play any sounds
localscript:
1 | script.Parent.ClickDetector.MouseClick:Connect( function () |
2 | print ( "clicked" ) |
3 | game.ReplicatedStorage.HealingEvents.SmallHeal:FireServer() |
4 | print ( "sent" ) |
5 | script.Parent:Destroy() |
6 | end ) |
script:
1 | game.ReplicatedStorage.HealingEvents.SmallHeal.OnServerEvent:Connect( function () |
2 | game.Players.PlayerAdded:Connect( function (plr) |
3 | local hum = plr.Character.Humanoid |
4 | game.Workspace.Sounds.Crunch:Play() |
5 | hum.Health = hum.Health + 10 |
6 | end ) |
7 | end ) |
The answer is that Connect can not have a capital C it must be "connect".
Local:
1 | script.Parent.ClickDetector.MouseClick:connect( function () |
2 | print ( "clicked" ) |
3 | game.ReplicatedStorage.HealingEvents.SmallHeal:FireServer() |
4 | print ( "sent" ) |
5 | script.Parent:Destroy() |
6 | end ) |
Server:
1 | game.ReplicatedStorage.HealingEvents.SmallHeal.OnServerEvent:connect( function () |
2 | game.Players.PlayerAdded:Connect( function (plr) |
3 | local hum = plr.Character.Humanoid |
4 | game.Workspace.Sounds.Crunch:Play() |
5 | hum.Health = hum.Health + 10 |
6 | end ) |
7 | end ) |