of     1   

DJSasuke1963
#139908646Thursday, July 10, 2014 8:45 PM GMT

Basically... I've created a move, but when cast the player can be dmged by it as well.. How would I stop this?
phoenix53124
#139908808Thursday, July 10, 2014 8:46 PM GMT

I'm gonna need the part of the script that causes damage and the associated variables and such.
devTree
#139908891Thursday, July 10, 2014 8:47 PM GMT

In the localscript where the damage is dealt with, then in that function, check if the character being hurt is LocalPlayers character.
DJSasuke1963
#139909219Thursday, July 10, 2014 8:51 PM GMT

The main script is a localscript but the damage moves a script inside the localscript into the brick when its placed heres the script inside of it function onDamage(Part) if Part.Parent:findFirstChild("Humanoid") ~= nil then script.Disabled = true for i = 1, 3 do Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -5 Part.Parent.Humanoid.Sit = true wait(0.05) end Part.Parent.Humanoid.Sit = false script.Parent:remove() end wait(0.025) end script.Parent.Touched:connect(onDamage)
phoenix53124
#139909457Thursday, July 10, 2014 8:53 PM GMT

Put a StringValue called 'TAG' and have the value be the player's name, put it in the part. function onDamage(Part) if Part.Parent:findFirstChild("Humanoid") ~= nil and game.Players:GetPlayerFromCharacter(Part.Parent).Name~=script.Parent.TAG.Value then script.Disabled = true for i = 1, 3 do Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -5 Part.Parent.Humanoid.Sit = true wait(0.05) end Part.Parent.Humanoid.Sit = false script.Parent:remove() end wait(0.025) end
phoenix53124
#139909618Thursday, July 10, 2014 8:55 PM GMT

Also...How would this work if it disables itself?
devTree
#139909961Thursday, July 10, 2014 8:58 PM GMT

function onDamage(Part) if Part.Parent:findFirstChild("Humanoid") ~= nil and game.Players:GetPlayerFromCharacter(Part.Parent) ~= game.Players.LocalPlayer then script.Disabled = true for i = 1, 3 do Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -5 Part.Parent.Humanoid.Sit = true wait(0.05) end Part.Parent.Humanoid.Sit = false script.Parent:remove() end wait(0.025) end script.Parent.Touched:connect(onDamage)
DJSasuke1963
#139910066Thursday, July 10, 2014 8:59 PM GMT

In another script I have made it so the brick gets named the casters playername, can i use this instead and if so how?
devTree
#139910133Thursday, July 10, 2014 9:00 PM GMT

Use my script.
DJSasuke1963
#139910702Thursday, July 10, 2014 9:06 PM GMT

How does it work? (Explain whats going on please xDD)
devTree
#139911111Thursday, July 10, 2014 9:10 PM GMT

function onDamage(Part) if Part.Parent:findFirstChild("Humanoid") ~= nil and not game.Players:GetPlayerFromCharacter(Part.Parent) ~= game.Players.LocalPlayer then script.Disabled = true for i = 1, 3 do Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -5 Part.Parent.Humanoid.Sit = true wait(0.05) end Part.Parent.Humanoid.Sit = false script.Parent:remove() end wait(0.025) end script.Parent.Touched:connect(onDamage) There, fixed It checks if the player that the character which is getting hurt is not the LocalPlayer. If it isn't, it hurts the character.

    of     1