local plr = game.Players.LocalPlayer local char = plr.Character or plr.CharacterAdded:wait() repeat wait() until plr.Character.Humanoid local humanoid = plr.Character.Humanoid local mouse = plr:GetMouse() canhit = false canswing = true local debris = game:GetService("Debris") mouse.KeyDown:connect(function(key) if key == "e" and canswing == true then canswing = false canhit = true local hitting = Instance.new('Part', char) hitting.Transparency = 1 hitting.Size = Vector3.new(2,2,2) hitting.Name = 'Part' hitting.Anchored = false hitting.CanCollide = false hitting.CFrame = char["HumanoidRootPart"].CFrame * CFrame.fromEulerAnglesXYZ(0, 0, 0) local weld = Instance.new('Weld', hitting) weld.C0 = char.HumanoidRootPart.CFrame:inverse() * hitting.CFrame weld.Part0 = char.HumanoidRootPart weld.Part1 = hitting hitting.Orientation = char.HumanoidRootPart.Orientation debris:AddItem(hitting,0.5) hitting.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Humanoid.Health > 0 and hit.Parent.Humanoid:FindFirstChild(char.Name) == nil then if hit.Parent.Humanoid:FindFirstChild(plr.Character.Name) == nil and canhit == true then hit.Parent.Humanoid:TakeDamage(100) local Tag = Instance.new("StringValue") Tag.Name = char.Name Tag.Parent = hit.Parent.Humanoid Tag.Value = "Hit Indicator" debris:AddItem(Tag, .2) canhit = false end end end) local Punch = char.Humanoid:LoadAnimation(script.Punch) Punch:Play() canhit = true wait(1) canhit = false canswing = true end end)
Basically when i kill someone with my punch it only shows for me and not them It's not because of Filtering Enabled (It might be) My friend said it was because of the variables but he said he can't help.
What's done in LocalScripts isn't replicated (unless the client owns the Network Ownership, like with the Character), so killing another player from a LocalScript will only be visible to the player to whom the LocalScript belongs.
Everything you need to be visible to other players and the server needs to be done on the Server, which you can communicate to from your LocalScript with RemoteEvents and RemoteFunctions.