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: Question

Previous Thread :: Next Thread 
ColinRocks99 is not online. ColinRocks99
Joined: 04 May 2013
Total Posts: 1533
19 Feb 2017 11:11 AM
How can I create a script that will control the tools a player holds? What I'm trying to do is make it so a tool cannot be unequipped, but the script can unequip the tool when needed.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
19 Feb 2017 11:15 AM
If you're trying to work around tool functions, it would be better to make your own tool system with UIS. I don't think you can stop players from unequipping tools.


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
19 Feb 2017 11:15 AM
And when I say "functions" I mean the literary definition of "function"


Report Abuse
andr315j is not online. andr315j
Joined: 25 Mar 2012
Total Posts: 518
19 Feb 2017 11:18 AM
Put this in a LocalScript inside the tool!

wait(1)
local tool = script.Parent
local player = game.Players.LocalPlayer
local hum = player.Character.Humanoid

tool.Equipped:connect(function(mouse)
game:GetService("RunService").RenderStepped:connect(function()
if not hum.Parent:FindFirstChild(tool.Name) then
hum:EquipTool(tool)
end
end)
end)

--Ur Welcome!
Report Abuse
andr315j is not online. andr315j
Joined: 25 Mar 2012
Total Posts: 518
19 Feb 2017 11:19 AM
Figure out the rest from there
Report Abuse
ColinRocks99 is not online. ColinRocks99
Joined: 04 May 2013
Total Posts: 1533
19 Feb 2017 11:47 AM
Why are you so extra? Is there any flaws with ### following: local character = script.Parent.Parent.Parent local player = game.Players:GetPlayerFromCharacter(character) wait(0.1) -- small wait time while true do wait(0.03) if script.Parent.Value ## 1 then script.Parent.Parent.Parent.Humanoid:EquipTool(player.Backpack.Splattershot) elseif ################### ## # then script.Parent.Parent.Parent.Humanoid:EquipTool(player.Backpack.Splatroller) end end
Report Abuse
ColinRocks99 is not online. ColinRocks99
Joined: 04 May 2013
Total Posts: 1533
19 Feb 2017 11:47 AM
( I have no idea why Roblox safechatted ### heck out of ### forums ) local character = script.Parent.Parent.Parent local player = game.Players:GetPlayerFromCharacter(character) wait(0.1) -- small wait time while true do wait(0.03) if script.Parent.Value ## 1 then script.Parent.Parent.Parent.Humanoid:EquipTool(player.Backpack.Splattershot) elseif ################### ## # then script.Parent.Parent.Parent.Humanoid:EquipTool(player.Backpack.Splatroller) end end
Report Abuse
ColinRocks99 is not online. ColinRocks99
Joined: 04 May 2013
Total Posts: 1533
19 Feb 2017 11:48 AM
Ok you know what, forget I even said anything.
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