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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Break script if an tool is equipped ...

Previous Thread :: Next Thread 
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
21 Sep 2016 08:50 AM
local tool = script.Parent.Parent:GetChildren()


if tool.Equipped:connect() then return end

That will work ?
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
21 Sep 2016 08:55 AM
script.Parent.Equipped:connect(error)
Report Abuse
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
21 Sep 2016 08:58 AM
Players.Player1.Backpack.Shoot:4: attempt to index field 'Equipped' (a nil value)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
21 Sep 2016 08:59 AM
Uh, why do you want to break a script if the tool is equipped?


Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
21 Sep 2016 09:00 AM
if game.Players:findFirstChild(script.Parent.Parent.Parent.Name) then
--equipped
else
--nope
end
Report Abuse
vexieh is not online. vexieh
Joined: 22 Oct 2009
Total Posts: 3468
21 Sep 2016 09:00 AM
You should go back to the basics of scripting


Report Abuse
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
21 Sep 2016 09:03 AM
@vexieh
Why ?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
21 Sep 2016 09:11 AM
local equipped = false

if equipped then return end

tool.Equipped:connect(function()
equipped = true
end)

tool.Unequipped:connect(function()
equipped = false
end)





Report Abuse
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
21 Sep 2016 09:19 AM
Players.Player1.Backpack.Shoot:9: attempt to index global 'tool' (a nil value)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
21 Sep 2016 09:22 AM
smh im tired of these idiots


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
21 Sep 2016 09:23 AM
#########################################################
Report Abuse
vexieh is not online. vexieh
Joined: 22 Oct 2009
Total Posts: 3468
21 Sep 2016 09:23 AM
@dadibox1234
Because by the looks of it you barely even understand the basics.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
21 Sep 2016 09:23 AM
http://wiki.roblox.com/index.php?title=Intro_to_Scripting


Report Abuse
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
21 Sep 2016 09:25 AM
local tool = game.Players.Localplayer.Backpack:GetChildren()

That will work ?
Report Abuse
vexieh is not online. vexieh
Joined: 22 Oct 2009
Total Posts: 3468
21 Sep 2016 09:25 AM
Not in the slightest


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
21 Sep 2016 09:26 AM
local player = game.Players.Localplayer
local tool = player.Backpack['SOMETOOL']


Report Abuse
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
21 Sep 2016 09:27 AM
But i want to choose all tool ... :/
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
21 Sep 2016 09:29 AM
http://wiki.roblox.com/?title=Loops


Report Abuse
vexieh is not online. vexieh
Joined: 22 Oct 2009
Total Posts: 3468
21 Sep 2016 09:29 AM
Definitely go back to the basics, you don't even know what you're doing.


Report Abuse
vexieh is not online. vexieh
Joined: 22 Oct 2009
Total Posts: 3468
21 Sep 2016 09:31 AM
http://wiki.roblox.com/index.php?title=Table#Iterating_over_arrays


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