Script in workspace:
local humanoid = game.Workspace.Speler.Humanoid
game.Players.PlayerAdded:connect(function(player)
player = player
end)
humanoid.MaxHealth = 0
humanoid.Health = 0
humanoid.HealthChanged:connect(function(health)
local players = game:GetService("Players")
humanoid.Parent.Head.Touched:connect(function(otherpart)
if otherpart.Name == "Handle" then
local player = otherpart.Parent.Parent
local replicatedstorage = game:GetService("ReplicatedStorage")
local remote = Instance.new("RemoteEvent", replicatedstorage)
remote:FireClient(player)
end
end)
end)
LocalScript in startergui:
local remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
remote.OnClientEvent:connect(function()
local health = game.Workspace.Speler.Humanoid.Health
game.Workspace.Speler.Humanoid.MaxHealth = 100
game.Workspace.Speler.Humanoid.Health = 100
end)
What i wanted to do was that if a player damages a humanoid, the damage would only be visible to the client. It did work fine with 1 player in Roblox Studio, but it doesn't work in the localserver.

3 comments
The player with the sword does damage it in Roblox Studio, but in the localserver the humanoid get's no damage. That's what i meant
who is "Speler"? Speler doesnt exist in real servers
Speler is a model in workspace