|
| 23 Jan 2012 05:25 PM |
This is my script:
local debounce = false
function getPlayer(humanoid) local players = game.Players:children() for i = 1, #players do if players[i].Character.Humanoid == humanoid then return players[i] end end return nil end
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
script.Parent:clone().Parent = player.Backpack
wait(2) debounce = false end end
script.Parent.Parent.Touched:connect(onTouch)
And output: 16:22:36 - Touched is not a valid member of Backpack 16:22:36 - Script "Players.monkey1589.Backpack.Confetti.Giver Script", Line 30 16:22:36 - stack end
Line 30 is: script.Parent.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 23 Jan 2012 05:32 PM |
| .Touched isn't an event for the 'Backpack' object. |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2012 05:33 PM |
| Is it something to do with Pcall(). If it is, where do I place them? |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2012 05:33 PM |
| I know it says that in output. but what line can fix it. |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2012 05:34 PM |
| I meant what is the correct line? Sorry bout that. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 23 Jan 2012 05:44 PM |
| Fix the connection line so it's to the part, not the backpack. |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2012 09:18 PM |
| Just say the correct line. i'm not advanced. I'm in the middle of beginner and intermediate. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 23 Jan 2012 09:32 PM |
| If you're there, you should be able to do this. Also, I'm not a mind reader, I don't know what you Explorer looks like. |
|
|
| Report Abuse |
|
|