So I'm working on a medikit tool (not really for a certain game, I'm just trying to learn how to use remote functions and events since FE is now forced on every game), and I've properly set it up and stuff. The problem is, it doesn't seem to work, despite the fact that nothing seems to appear in the output log related to my scripts.
The local script's content is
script.Parent.Parent.Activated:Connect(function() game.ReplicatedStorage.Heal:InvokeServer(25) script.Parent.Parent:Destroy() end)
The script is inside a tool's handle.
The server script, which is in ServerScriptStorage, has the following content:
local function heal(player, x) player.Character.Humanoid.Health = player.Character.Humanoid.Health end game.ReplicatedStorage.Heal.OnServerInvoke = heal
I know I'm doing something wrong since it won't work, but why won't it?
The problem is at line 2 in the server script, which is in ServerScriptStorage, you forgot to add, The line should be like this
player.Character.Humanoid.Health = player.Character.Humanoid.Health + 1
Make sure to change 1 to whatever number you want.