Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My swords dont work in any gear givers whatsoever. How is this possible?

I have three different swords that were all made by me and any, I mean any gear givers don't work with it. I have a Handle, it's a tool, and the swords actually work properly.

If you would like me to provide my sword scripts please let me know by posting a comment.

wait (.1)  -attack animations
local CanAttack = true 
  
script.Parent.Activated:connect(function()
 local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
 local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
 
 idle:Play()
end) 

script.Parent.Activated:connect(function()
   local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
   local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)

if CanAttack == true then
    attack:Play()
    idle:Stop()
    CanAttack = false
    wait(1)
    attack:Stop()
    idle:Play()
    CanAttack = true
    script.Parent.CanDamage.Value = true
   end
end)
wait (.1) --equip ani
wait(1)
local tool =script.Parent
local plr=game:GetService("Players").LocalPlayer
local equipped = false
local anim = game:GetService("ReplicatedStorage").INSERT_ME_IN_REPLICATED_STORAGEEquip_ANI
local equip = plr.Character.Humanoid:LoadAnimation(anim)
tool.Equipped:connect(function()
	equipped = true
	equip:Play()
end)
tool.Unequipped:connect(function()
	equipped = false
	equip:Stop()
end)
local SP = script.Parent --welding script
for _, V in pairs(SP:GetChildren()) do
    if V:IsA("BasePart") then
        if Previous~=nil then
            local Weld=Instance.new("Weld")
            Weld.Part0=Previous
            Weld.Part1=V
            Weld.C0=Previous.CFrame:inverse()
            Weld.C1=V.CFrame:inverse()
            Weld.Parent=Previous
        end
        V.Anchored=false
        Previous=V
    end
end

2 comments

0

"If you would like me to provide my sword scripts please let me know by posting a comment." THAT’S THE WHOLE POINT OF THIS SITE!! POST YOUR CODE! AND GET HELP! NOT THIS! USE COMMON SENSE!

0

Incapaz back at it again... dw Hyped Ill attempt to help you.

1 answer

To be honest i'd recommend making your own giver. There fairly easy to do. Here is how i would go about combating this:

  1. Make your self a giver (model)

  2. insert a script into the part of the model you want to be triggered on touch.

  3. insert the weapon inside a folder in 'server storage' for convenience and safety

  4. Type some code like this:

local part = script.Parent
local sword = game.ServerStorage.folder:WaitForChild("Sword")

part.Touched:Connect(function(hit)

	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)	
	sword:Clone().Parent = plr.Backpack
end)

Hope this helps :)

BTW: On lines 06-07 there should be some validation (if statements) to make sure that an NPC/Part touches the giver otherwise it may make the giver break.

I'm sure Incapaz will pick up on something though.

5 comments

0

This oddly works with other gears but not mine.

0

hmm this is very weird haha

0

you may have to screen shot your tool using software called Gyazo and link me it

0

Because the cloning part of the weapon into the player shouldn't have anything todo with the scripts of your weapon unless you have a part in the code which removes the tool from the players backpack as soon as it is cloned

0

I just created a Gui that gives you the gear, so anyways thank you for trying to help me. :-)

This discussion is preserved as it was. New answers, comments, and votes are closed.