Im trying to increase the Health/MaxHealth values through a GUI Button, but I dont really understand serversided stuff very well. I keep getting FireServer is not a valid member of Script "ReplicatedStorage.Heal_Me".
How do I set this up
You dont need a localscript to fire to a serverscript to change a players health. Because your character is client-sided, if you change any property of your humanoid it will change to the whole server. Ditch that remoteevent and serverscript and just make it really simple. Something like this: (Place this in a localscript inside the button)
local player = game.Players.LocalPlayer local button = script.Parent repeat char = player.Character wait() until char local hum = char:FindFirstChildWhichIsA("Humanoid") button.Activated:Connect(function() hum.MaxHealth = hum.MaxHealth + 100 hum.Health = hum.Health + 100 end)
It would be also great to check the devwiki: They got examples and tutorials on how to use and make things.
https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events
Made Remove Event in Replicated Storage named "healthier"
Made a Script in ServerScriptService named "healthier" code:
game:GetService("ReplicatedStorage").healthier.OnServerEvent:Connect(function(Player) Player.Character.Humanoid.MaxHealth = Player.Character.Humanoid.MaxHealth + 10 end)
and finally made Button and a child localscript with this code:
script.Parent.MouseButton1Click:Connect(function() game:GetService("ReplicatedStorage").healthier:FireServer() end)
RemoveEvents were confusing at first, but actually they are pretty easy. Feel free to ask for explanations