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

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

Asked by 6 years ago
Edited 6 years ago

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
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! User#19524 175 — 6y
0
Incapaz back at it again... dw Hyped Ill attempt to help you. NoirPhoenix 148 — 6y

Closed as Not Constructive by User#19524, Zafirua, and Link150

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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.

0
This oddly works with other gears but not mine. HypedNebula 28 — 6y
0
hmm this is very weird haha NoirPhoenix 148 — 6y
0
you may have to screen shot your tool using software called Gyazo and link me it NoirPhoenix 148 — 6y
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 NoirPhoenix 148 — 6y
0
I just created a Gui that gives you the gear, so anyways thank you for trying to help me. :-) HypedNebula 28 — 6y
Ad