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: How can I make a player not be able to deselect a tool

Previous Thread :: Next Thread 
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
14 Feb 2014 04:15 PM
^^^
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
14 Feb 2014 10:45 PM
Bump
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
14 Feb 2014 10:46 PM
A Tool or a HopperBin?

With tools you just set the parent of the tool to the player's character whenever it's unequipped.

But this just isn't possible with a HopperBin.
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
14 Feb 2014 11:48 PM
Its a tool, this is the script... The first part works but the function doesn't

script.Parent.Parent.Character.Humanoid:EquipTool(script.Parent.Flashlight)

function Unequip()
script.Parent.Parent.Character.Humanoid:EquipTool(script.Parent.Flashlight)
end
script.Parent.Flashlight.Unequipped:connect(Unequip)
Report Abuse
Hazania is not online. Hazania
Joined: 04 Jun 2010
Total Posts: 1344
14 Feb 2014 11:52 PM
Instead of Unequipped:connect, try Unselected:connect

~ I may be wrong but oh well :P
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
14 Feb 2014 11:57 PM
Well the is no event called Unselected... Unequiped is the right event I just can't seem to figure out why it isn't working...
Report Abuse
Hazania is not online. Hazania
Joined: 04 Jun 2010
Total Posts: 1344
14 Feb 2014 11:58 PM
Meant Deselected* my bad.. http://wiki.roblox.com/index.php/Deselected_(Event)
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 12:00 AM
Hmmm put in localscript,and do this maybe?:

plr = game.Players.LocalPlayer
tool = script.Parent
tool.Unequipped:connect(function()
tool.Parent = plr.Character
end)

Tell me if it works :3
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 12:01 AM
If mine doesn't work,nvm,try the deselected..
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
15 Feb 2014 12:05 AM
In the tool put this script


if tool.Parent == game.Players.LocalPlayer.Backpack -- Assuming tool is defined
tool.Parent = game.Players.LocalPlayer.Character
end

--LocalScript
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
15 Feb 2014 12:08 AM
Wow very strange error I just got from output using your script... It activated because the error happened when I Unequiped the tool... Heres the error:
00:05:33.588 - Something unexpectedly tried to set the parent of Flashlight to Player1 while trying to set the parent of Flashlight. Current parent is Backpack.



--Heres the strange thing... I have nothing else trying to set the parent of that tool
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
15 Feb 2014 12:09 AM
let me check back on my script in my game i've made it has an auto-equip
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
15 Feb 2014 12:10 AM
There is, the one when you unequip it. It'll have it's parent set to Backpack instead of the Character.
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
15 Feb 2014 12:13 AM
Tools are equipped when the parent is the player so...

What the other guy said should work

plr = game.Players.LocalPlayer
tool = script.Parent
tool.Unequipped:connect(function()
tool.Parent = plr.Character
end)
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
15 Feb 2014 12:14 AM
Andrew your script messed up the welds on the flashlight I don't even know how...
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
15 Feb 2014 12:14 AM
Tool = script.Parent
Player = game.Players.LocalPlayer
Character = Player.Character

while wait() do
if Tool.Parent == Player.Backpack then
Tool.Parent = Character
end
end
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
15 Feb 2014 12:20 AM
Andrew's is working :) Thanks andrew I was getting really confused at why it wasn't working.
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
15 Feb 2014 12:22 AM
Your welcome, i said i had a script that did that in my game as i needed one so your welcome
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 12:22 AM
@andrew
Wouldn't my script(posted above)
Do the same thing..??

plr = game.Players.LocalPlayer
tool = script.Parent
tool.Unequipped:connect(function()
tool.Parent = plr.Character
end)
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
15 Feb 2014 12:22 AM
Now does anyone know how to remove the tool button at the bottom without removing the welds?
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
15 Feb 2014 12:24 AM
game.StarterGui:SetCoreGuiEnabled("Backpack", false)
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
15 Feb 2014 10:25 PM
island sorry for late reply but that would not work because when unequipped is fired it doesn't hit the backpack straight away
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 10:27 PM
Oh, k
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