Example:
function Died() script.Parent.SwordName.Value:Destroy() -- a sword gets cloned into npc from value, value has the sword's name so how do u destroy the sword checking the value with the script ????? im so confuuused end script.Parent.Human.Died:connect(Died)
My other script clones the sword into the npc from a value, but i want this when he dies the script checks the value's name and according to that value's name the script should remove the sword from the value's name. HOW I DO DAT ???
Try this code out:
function Died() script.Parent.SwordName["Value"]:Destroy() -- a sword gets cloned into npc from value, value has the sword's name so how do u destroy the sword checking the value with the script ????? im so confuuused end script.Parent.Human.Died:connect(Died)
I haven't tested it, but it should work just fine.
The script down below will check the sword's value. If it is that value, then it will destroy the sword. If the value is not named correctly, it will print "Not named correctly".
function Died() if script.Parent.SwordName.Value == "Value Name" then script.Parent.SwordName:Destroy() else print("Not named correctly") end end script.Parent.Human.Died:connect(Died)