Yeah So For This Place I Am Making.I Am Making A Sword Kill Script.But I Keep On Getting Errors.I Also Keep On Removing And Adding Things And It's Really Getting On My Nerves.Can Someone Carefully Look Through The Code And Point Out What I Have Done Wrong?
Here Is The Script:
if game.Parent.Player.Humanoid.Health == 0 then if game.Player.Sword == game.Sword.Parent then --Don't Know What I Am Doing Right Now game.Player.Sword.Parent (function(TouchedOn) if game.Sword.Player (TouchedOn) then game.Player.Humanoid (TouchedOn) game.Sword.Player.Humanoid (TouchedOn) .Health = 25 end end) end end
I dont think one line of your code is functional, but you can try using this outline instead:
script.Parent.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChildOfClass("Humanoid") if hum then hum.Health = hum.Health - 25 end end)
This would need to be in the sword handle part.