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
 

Re: Seat Crap

Previous Thread :: Next Thread 
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
20 Mar 2012 05:07 PM
h = Instance.new("Hint")
h.Text = "Select the tool, click at a pig to fire away, and get points!"

script.Parent.ChildAdded:connect(function(plr)
user = game.Players[plr.Name]
h.Parent = user.Character
game.Lighting.Tool:Clone().Parent = user.Backpack
end

script.Parent.ChildRemoved:connect(function(plr)
user = game.Players[plr.Name]
h.Parent = nil
user.Backpack.Tool:Destroy()
end

-[I've been to Nil]-
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
20 Mar 2012 05:18 PM
I must have been typing too fast...

It's supposed to clone a tool from lighting then give it to the player once he sits in the chair. A hint is also supposed to appear.

When the player gets up the tool is removed and the hint will be gone.

No output.

-[I've been to Nil]-
Report Abuse
Programmer101 is not online. Programmer101
Joined: 27 Jul 2009
Total Posts: 1043
20 Mar 2012 05:19 PM
I'm not the best scripter, but I know a couple of your mistakes...

"script.Parent.ChildAdded:connect(function(plr)"

When you use a (function (), you need to end the "()".

script.Parent.ChildAdded:connect(function (plr)
-- Script Here
end)

Also, I'm PRETTY sure you have to say the parent of the cloned object like this:

e = game.Lighting.Tool:Clone()
e.Parent = user.Backpack

I don't know much about tools, but thats what I got at glance.
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
20 Mar 2012 05:30 PM
No,

game.Lighting.Tool:Clone().Parent = user.Backpack

is still valid.

As for the functions, they can be both ways.

-[I've been to Nil]-
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
20 Mar 2012 05:47 PM
-Faic palm-

I didn't add ')' after the ends...
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