generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Output says its wrong even though it works.

Previous Thread :: Next Thread 
monkey1589 is not online. monkey1589
Joined: 06 Feb 2010
Total Posts: 2334
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 is not online. 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
monkey1589 is not online. monkey1589
Joined: 06 Feb 2010
Total Posts: 2334
23 Jan 2012 05:33 PM
Is it something to do with Pcall(). If it is, where do I place them?
Report Abuse
monkey1589 is not online. monkey1589
Joined: 06 Feb 2010
Total Posts: 2334
23 Jan 2012 05:33 PM
I know it says that in output. but what line can fix it.
Report Abuse
monkey1589 is not online. monkey1589
Joined: 06 Feb 2010
Total Posts: 2334
23 Jan 2012 05:34 PM
I meant what is the correct line? Sorry bout that.
Report Abuse
UFAIL2 is not online. 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
monkey1589 is not online. monkey1589
Joined: 06 Feb 2010
Total Posts: 2334
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image