|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 518 |
|
|
| 19 Feb 2017 11:19 AM |
| Figure out the rest from there |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 19 Feb 2017 11:48 AM |
| Ok you know what, forget I even said anything. |
|
|
| Report Abuse |
|
|