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 » Scripters
Home Search
 

Re: Making a tool giver

Previous Thread :: Next Thread 
Slateon is not online. Slateon
Joined: 30 Jul 2011
Total Posts: 13
08 Aug 2016 05:34 PM
Hi, I've been having problems with a clickdector to equip the players that click this block a tool. Its based off of the prison life equipping mechanics (click on gun, gun disappears, gun equips, gun appears back in the same place) So far I have:

local function onClicked()

script.Parent.Union.Transparency = 1
script.Parent.Part.Transparency = 1
game.Lighting.drink.clone() = Player.Backpack
wait(15)
script.Parent.Union.Transparency = 0
script.Parent.Part.Transparency = 0



end

script.Parent.ClickDetector.MouseClick:connect(onClicked)


Please help, this is my first REAL experience programming/scripting.
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
08 Aug 2016 05:55 PM
regular script

local function onClicked(plr)

script.Parent.Union.Transparency = 1
script.Parent.Part.Transparency = 1
game.Lighting.drink.clone() = plr.Backpack
wait(15)
script.Parent.Union.Transparency = 0
script.Parent.Part.Transparency = 0



end

script.Parent.ClickDetector.MouseClick:connect(onClicked)


Report Abuse
Slateon is not online. Slateon
Joined: 30 Jul 2011
Total Posts: 13
08 Aug 2016 06:56 PM
Thank you so much! Gladly appreciate the help. :D
Report Abuse
Slateon is not online. Slateon
Joined: 30 Jul 2011
Total Posts: 13
08 Aug 2016 07:03 PM
@pelicans, I tested it and still does not work, any other suggestions?
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
08 Aug 2016 07:30 PM
error?
did u get the tool?


Report Abuse
Slateon is not online. Slateon
Joined: 30 Jul 2011
Total Posts: 13
08 Aug 2016 07:38 PM
I didn't receive the tool. Output bar says:

Workspace.Model.Script:5: unexpected symbol near '='
Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
08 Aug 2016 07:43 PM
wow didnt c that error

this
game.Lighting.drink.clone() = plr.Backpack

should be

game.Lighting.drink:Clone().Parent = plr.Backpack


Report Abuse
Slateon is not online. Slateon
Joined: 30 Jul 2011
Total Posts: 13
08 Aug 2016 07:45 PM
YESSSS! Finally worked, thank you so much! By any chance could you explain to me why you had to add parent to the end of clone? as well as a colon?
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
08 Aug 2016 07:48 PM
game.Lighting.drink:Clone().Parent = plr.Backpack

he added parent because he is parenting the cloned object to the player's backpack

and he added a colon because it's :Clone() not .Clone()
Report Abuse
Slateon is not online. Slateon
Joined: 30 Jul 2011
Total Posts: 13
08 Aug 2016 07:50 PM
Thanks for explaining that to me, really helped :D
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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