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: Equipping a weapon without the Core Gui

Previous Thread :: Next Thread 
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Feb 2014 02:38 PM
Is it possible?
For example, I'm making a hotkey to equip weapons rather than using the Core Gui (I think the core Gui is horrible and takes up too much space.)

I'd have to reckon that this is possible, but I was looking up methods for tools and found nothing.
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
15 Feb 2014 02:40 PM
Put the tool in their character. Will not work with Hopperbins however.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 02:44 PM
Something like this?


Equipped = false
plr = game.Players.LocalPlayer
Mouse = plr:GetMouse()
Mouse.KeyDown:connect(function(k)
if k == "e" and not Equipped then
Equipped = true
Tool = game.Lighting.Tool:clone()
Tool.Parent = plr.Character
else
plr.Character.Tool:destroy()
end
end)
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Feb 2014 02:49 PM
Interesting, thanks very much guys, this is far easier than I suspected.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 02:54 PM
Yep keydown events,if statements and cloning,that's about it :P


-yep this is a signature,but not one I've used b4,I sometimes have a siggy,but copy+pase?nah,new one everytime,woow,u wasted A LOT of time reading my siggy-
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Feb 2014 03:03 PM
I just so wish there was an equip bool value, all this cloning is inefficient.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 03:08 PM
plr.Character.Humanoid:EquipTool(toolname)
Something like that I belive,I've seen it b4,lookit up :)
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Feb 2014 03:23 PM
It exists 0_0
Why is none of this in the object browser? It makes it so unreliable.
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Feb 2014 03:25 PM
Scratch that, it is.

It's just under Humanoid instead of Tool, like I was going to guess that.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 03:30 PM
Also,there's a way of doing it so a function is run that'll clone whatever it is,without whole bunch of copy pasting..
function EquipMahTool()
game.Lighting[""..toolname..""]:clone().Parent = Plr.Character
end
Plr = game.Players.LocalPlayer
Mouse = Plr:GetMouse()
Mouse.KeyDown:connect(function(k)
if k == "e" then
toolname = "tool1"
EquipMahTool()
elseif key == "q" then
toolname = "tool2"
EquipMahTool()

end
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 03:32 PM
Lol,just an example,the one I just posted wasn't full thing,and yeah EquipTool is probly more efficient,so use that in my original script lol
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 03:37 PM
And don't forget,everytime it "removes" the tool,set equipped to false
Report Abuse
MARIOSTAR6464 is not online. MARIOSTAR6464
Joined: 21 Jul 2008
Total Posts: 13674
15 Feb 2014 04:01 PM
Thanks for taking the time to write that, but I already scripted something to my own needs.

I was experimenting with the WheelUp method and WheelDown method of Mouse but they don't work. Also MouseWheelDown() doesn't exist. >:(

Awh well, thanks again anyway ^^
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
15 Feb 2014 05:35 PM
Np,glad I could help:)
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