|
| 13 Dec 2016 01:08 PM |
local damager = script.Parent local on = damager.On local player =game.Players.LocalPlayer
script.Parent.Touched:connect(function(hit) local creator = hit:WaitForChild("Humanoid"):FindFirstChild("creator") if (creator == nil and on.Value==true) then local tag = Instance.new('ObjectValue',hit:WaitForChild("Humanoid")) tag.Name = 'creator' tag.Value = player wait(3) tag:Destroy() end end)
why does this not work
|
|
|
| Report Abuse |
|
|
|
| 13 Dec 2016 01:14 PM |
change "local creator" to local creator = hit:findFirstChild("Humanoid"):findFirstChild("creator") (doesnt work)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 13 Dec 2016 02:02 PM |
| hit will return a #### #### if it hits the player such as arm or his legs so instead use hit.Parent as this is the humanoid |
|
|
| Report Abuse |
|
|
| |
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 13 Dec 2016 02:47 PM |
| Because the player's body parts don't have humanoids in them. Read the ouput. I hate it when people come to the forum and bump and annoyingly large number of times because they don't know how to read the output. |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 13 Dec 2016 02:48 PM |
| http://wiki.roblox.com/index.php?title=Intro_to_Scripting |
|
|
| Report Abuse |
|
|
|
| 14 Dec 2016 12:08 PM |
hahahahaha, im talking about the npc's humanoid
|
|
|
| Report Abuse |
|
|
|
| 14 Dec 2016 12:09 PM |
i hate it when an idiot pastes something when they dont know what im trying to do
|
|
|
| Report Abuse |
|
|
|
| 14 Dec 2016 12:25 PM |
BUMP, i look at the output everytime i test
|
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Dec 2016 01:25 PM |
| listen to us you foolish human script.Parent.Touched:connect(function(hit) local creator = hit:WaitForChild("Humanoid"):FindFirstChild("creator") hit will be a #### #### body parts do not have a humanoid in them looking at the output won't help if you don't know how to read it. |
|
|
| Report Abuse |
|
|
|
| 14 Dec 2016 01:50 PM |
listen to me, hit.parent didnt work, tht's why im here scrubs
|
|
|
| Report Abuse |
|
|
|
| 14 Dec 2016 01:51 PM |
m using waitforchild on top of tht
|
|
|
| Report Abuse |
|
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 14 Dec 2016 02:21 PM |
| You are the dictionary definition of an a scrub who only thinks he knows anything and is so annoying that he doesn't even deserve to be helped. |
|
|
| Report Abuse |
|
|
|
| 14 Dec 2016 02:49 PM |
no u, the 1 who posts hate messages about me on my thread, BUMP, some1 help me
|
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 14 Dec 2016 02:54 PM |
script.Parent.Touched:connect(function(part) local hum = part.Parent:FindFirstChild('Humanoid') local tag = hum and (hum:FindFirstChild('creator')or Instance.new('ObjectValue',hum).Name='creator') or nil if tag then tag.Value = player game:GetService('Debris'):AddItem(tag,3) end end)
Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil) |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 14 Dec 2016 02:57 PM |
Jk, I can't script.
This works: script.Parent.Touched:connect(function(part) local hum = part.Parent:FindFirstChild('Humanoid') local tag = hum and (hum:FindFirstChild('creator')or Instance.new('ObjectValue',hum)) or nil if tag then tag.Name = 'creator' tag.Value = player game:GetService('Debris'):AddItem(tag,3) end end)
Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 15 Dec 2016 01:29 PM |
Please learn to script first. THEN ask questions about it. |
|
|
| Report Abuse |
|
|
kaddad14
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 649 |
|
|
| 15 Dec 2016 01:34 PM |
| Waiting to know what the output even is... Or if you even tested it with prints. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2016 01:38 PM |
waiting for some1 to post something tht helps instead of slander
|
|
|
| Report Abuse |
|
|