Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Swapping Tools Script?

Asked by 10 years ago

So I wanted to ability to swap tools when pressing "q", I get no errors (I've never done this before). Am I approaching this the correct way, or am I doing something wrong?

Please note that this is not the whole script

01repeat wait()
02    Player = game.Players.LocalPlayer
03until Player
04 
05repeat wait()
06leaderstats = Player:FindFirstChild("leaderstats")
07until leaderstats
08 
09local Mouse = Player:GetMouse()
10 
11local Prim = true
12local Ak47 = Player.Backpack:FindFirstChild("AK47")
13local M9 = Player.Backpack:FindFirstChild("M9")
14 
15function SwapW(Ep, De)
View all 40 lines...
0
Hmm. This may work, although I'm not sure if manually parenting the tool in the Character actually equips it. SlickPwner 534 — 10y
0
Try using :WaitForChild() instead of :FindFirstChild(). (This isn't why it's not working, just a suggestion) Try placing the tools in a model created in the player instead of their Backpack. Tkdriverx 514 — 10y

Answer this question