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: Basic Question..(That I don't know)

Previous Thread :: Next Thread 
45CamDaMan is not online. 45CamDaMan
Joined: 01 Aug 2014
Total Posts: 210
04 Apr 2016 09:47 PM
I wanting a script that removes a tool from a player.
So the player clicks a block and It removes the tool from the player who clicked.
Please help!
45
Report Abuse
Phonicz is not online. Phonicz
Joined: 10 Apr 2010
Total Posts: 400
04 Apr 2016 09:58 PM
Dont know for sure how to do it but first off, please, PLEASE, learn to code and dont just take peoples knowledge from here and use it, Otherwise youll probally have a horrid game.

What you would do is find the person who clicked it,
Look in said persons backpack,
Look for said tool,
Delete said tool,
Done.

Look in the wiki for onclick or things around the click function
and look on the wiki for finding the player.

After that pretty simple.


Remember, Coding is trial and error my friend.


Yours Truly,
Phonicz
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Apr 2016 10:00 PM
Look in their backpack and character.
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Apr 2016 10:01 PM
if player.Backpack:FindFirstchild('ToolName') ~= nil then
player.Backpack:FindFirstchild('ToolName'):Destroy()
else if player.Character:FindFirstchild('ToolName') ~= nil then
player.Character:FindFirstchild('ToolName'):Destory()
end
Report Abuse
45CamDaMan is not online. 45CamDaMan
Joined: 01 Aug 2014
Total Posts: 210
04 Apr 2016 10:02 PM
Thank you will try!
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
04 Apr 2016 10:04 PM
Put this inside the part (Normal Script)

local click = Instance.new('ClickDetector',script.Parent)

click.MouseClick:connect(function(player)
if player.Backpack:FindFirstchild('ToolName') ~= nil then
player.Backpack:FindFirstchild('ToolName'):Destroy()
else if player.Character:FindFirstchild('ToolName') ~= nil then
player.Character:FindFirstchild('ToolName'):Destory()
end
end)
Report Abuse
45CamDaMan is not online. 45CamDaMan
Joined: 01 Aug 2014
Total Posts: 210
08 Apr 2016 06:09 PM
Please help (with a explanation please)
Report Abuse
LordKreduken is not online. LordKreduken
Joined: 07 Sep 2013
Total Posts: 109
08 Apr 2016 06:13 PM
Lua, FindFirstChild will return a bool value, so you don't need to have ~= nil
Report Abuse
45CamDaMan is not online. 45CamDaMan
Joined: 01 Aug 2014
Total Posts: 210
08 Apr 2016 06:20 PM
Please just give me a script that I just need to put in a block (THAT ALREADY HAS A CLICK DETECTOR)
Report Abuse
45CamDaMan is not online. 45CamDaMan
Joined: 01 Aug 2014
Total Posts: 210
08 Apr 2016 06:22 PM
BTW the script has 6 parents until workspace (so 7 if you count workspace)
Report Abuse
45CamDaMan is not online. 45CamDaMan
Joined: 01 Aug 2014
Total Posts: 210
08 Apr 2016 06:26 PM
Plz help
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