NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 07:59 AM |
kinda rushing through this urgent project and i might be making the stupidest of mistakes
function onTouch(hit) if hit.Parent then a = game.Players:FindFirstChild(hit.Parent.Name) game.ServerStorage["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name.Backpack) else return false end end |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:00 AM |
| oh nvm im an idiot i forgot the script.Parent:connect() thing xd |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 08:01 AM |
Try this, function onTouch(hit) if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then a = game.Players:FindFirstChild(hit.Parent.Name) game.ServerStorage["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name.Backpack) else return false end end
|
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:03 AM |
no w8 still not working and tried anon' is it because the tool is blank and has no children? ik that sounded wrong |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
YeahNick
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2536 |
|
|
| 08 Jul 2014 08:07 AM |
Well, 1. Yeah, you forgot the connection 2. Put the tool in Lighting, that way the scripts in it don't run and stuff 3. FindFirstChild needs a string, but you're entering an object (hit.Parent.Name.BackPack) 4. You don't really need return Should look like this
script.Parent.Touched:connect(function onTouch(hit) if hit.Parent then a = game.Players:FindFirstChild(hit.Parent.Name) game.Lighting["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name).Backpack end end) |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:09 AM |
| @yeahnick '(' expected near 'onTouch' |
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
| |
|
|
| 08 Jul 2014 08:23 AM |
function onTouch(hit) if hit.Parent then a = game.Players:FindFirstChild(hit.Parent.Name) game.Lighting["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name).Backpack end end script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
NiceCoder
|
  |
| Joined: 15 Oct 2012 |
| Total Posts: 6593 |
|
|
| 08 Jul 2014 08:24 AM |
| still not working i cant even figure out why |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 08:24 AM |
script.Parent.Touched:connect(function(hit) if hit.Parent then a = game.Players:FindFirstChild(hit.Parent.Name) game.Lighting["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name).Backpack end end)
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 08:25 AM |
function onTouch(hit) if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then a = game.Players:FindFirstChild(hit.Parent.Name) game.Lighting["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name).Backpack end end script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 08:26 AM |
script.Parent.Touched:connect(function(hit) if not hit.Parent:FindFirstChild("Humanoid") then return end a = game.Players:FindFirstChild(hit.Parent.Name) game.Lighting["Tool"]:clone().Parent = game.Players.FindFirstChild(hit.Parent.Name).Backpack end)
|
|
|
| Report Abuse |
|
|