When i attack a dummy another player doesnt see how many damage i did on that dummy, but i can see it. On my screen, the dummy's health is going low when i hit it, but on another players screen, its not going low. Its staying still. And i cant see what another player done too.
local Attack = true
script.Parent.Activated:Connect(function()
wait(0.1)
if Attack == true then
Attack = false
local character = script.Parent.Parent
local Humanoid = character:WaitForChild('Humanoid')
repeat
wait()
until character:FindFirstChild("HumanoidRootPart")
local part = Instance.new("Part", game.Workspace)
part.CanCollide = false
part.CFrame = character.HumanoidRootPart.CFrame
part.Size = Vector3.new(7.3, 4 ,3)
part.Transparency = 0.5
local Weld = Instance.new("Weld", part)
Weld.Part0 = character.HumanoidRootPart
Weld.Part1 = part
Weld.C1 = CFrame.new(0, 1, 2.5)
Weld.C0 = CFrame.new()
part.Touched:Connect(function(p)
local hum = p.Parent:FindFirstChildOfClass("Humanoid")
if p.Parent.Name == ("Mob") then
if script.Parent.CanDamage.Value == true then
script.Parent.CanDamage.Value = false
hum:TakeDamage(math.random(9,23))
wait(0.15)
script.Parent.CanDamage.Value = true
end
end
end)
wait(0.15)
part:Destroy()
wait(0.5)
Attack = true
end
end)
Is it a problem of a LocalScript? When i do this on normal script, i can damage on studio but not in normal game. If i do it on LocalScript, then this problem happening.

1 comment
Local changes are not replicated to the server. You have to use RemoteEvents / RemoteFunctions. Depends on if you want to return something back to the client.