``I've searched the question I've asked, but the answer was pretty much to weld the weapon to the player's right hand and use hopperbins.
** Problems:**
- I'm trying to make a weapon without using tools, and I feel like I can do it in a much better way.
- Should I copy the weapon and place it into the Character, or should I just put the weapon into the Character?
- Are there any other methods I should be using in order to have a more efficient script?
- Should I be doing anything else differently in order to have a more efficient script?
2. Is there an easier way to weld? (If you have an answer for this, please post.)
I use functions to where it just welds it into its original position, but sometimes the function does not do its job.
--------------------------------------------------------------------------------------------------------------------
Code errors: The weapon doesn't weld into its original place.
If this helps, I want it to be like the weapons you see in the ROBLOX game, Shard Online.
(I am using r15 in this script, but it would help me if you could tell me how to turn off r15.)
Code Info: This is a LocalScript located in the StarterPack. There are two unions inside of the LocalScript. The two unions are called Blade and Handle.
Code so far:
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
local UserInput = game:GetService("UserInputService")
local Player = game:GetService("Players").LocalPlayer
local Character
local RightHand
local Enabled = true
local Equipped = false
--Equip Function--
local function Equipped(key, GPE)
if not Enabled then return end
Enabled = false
if key.KeyCode == Enum.KeyCode.Q and not GPE then
if not Equipped then
for _,v in pairs(script:GetChildren()) do
if v.ClassName == "UnionOperation" or v.ClassName == "Part" or v.ClassName == "WedgePart" then
local new = v:Clone()
new.Parent = Character
end
end
local Handle = Character:FindFirstChild("Handle")
local Blade = Character:FindFirstChild("Blade")
local weld = Instance.new("ManualWeld", Handle)
weld.Part0, weld.Part1 = Handle, RightHand
weld.C0 = Handle.CFrame:toObjectSpace(RightHand.CFrame)
local weld = Instance.new("ManualWeld", Handle)
weld.Part0, weld.Part1 = Handle, Blade
weld.C0 = Handle.CFrame:toObjectSpace(Blade.CFrame)
Equipped = true
elseif Equipped then
for _,v in pairs(Character:GetChildren()) do
if v.ClassName == "UnionOperation" or v.ClassName == "Part" or v.ClassName == "WedgePart" then
if v.Name == "Blade" or v.Name == "Handle" then
v:Destroy()
end
end
end
Equipped = false
end
end
Enabled = true
end
------------------
UserInput.InputBegan:connect(Equipped)
--Gets Character--
local function GetCharacter(char)
Character = char
RightHand = Character:WaitForChild("RightHand")
end
if Player.Character then
GetCharacter(Player.Character)
end
Player.CharacterAdded:connect(GetCharacter)
------------------
~~~~~~~~~~~~~~~~~
Basically, I want to know the best methods to make an efficient non-tool and non-hopperbin weapon. I also want to know if there is an easier way to weld.

13 comments
Please fix your code block.
Oh, sorry. How do I do it though?
I am new to Scripting Helpers, so I do not know how to make code blocks and stuff.
Also, what's wrong with using a Tool? Hopperbins are currently deprecated because Tools can work w/o a handle. Are you actually trying to just have a weapon that doesn't use ROBLOX backpack?
Never mind. I figured it out.
@alphawolvess, yes I want the weapon to not use ROBLOX backpack. I don't want the weapon to appear in the player's backpack. I want the tool to be equipped by using a key
You can disable parts of the gamei,http://wiki.roblox.com/index.php?title=Disabling_parts_of_the_game_interface
@kingdom5, thanks for the link, but the player is still able to equip the weapon by using a number.
It seems to work ok for me? can you include a gif of what is happening and the code if possible
Okay, but the sword still isn't fixed. You'll see some random objects on my player's hand.
@kingdom5, actually the tool doesn't work at all when I turn off the backpack. sorry
Sorry for not being clear guys, but i want to know how to script the weapon efficiently. I'm not wanting to know how to make the weapon.
I am going to close this forum and accept the only answer.