#Everytime i try to equip, it keeps giving me a error

62 messages · Page 1 of 1 (latest)

undone bear
#

what i'm trying to do

fleet beacon
#

isn't it Motor6d

#

not Motor 6D

undone bear
olive pumice
#

Try Katana:WaitForChild("SeatheWeld")

exotic wasp
#

is WeaponWeld the Weapons folder

undone bear
undone bear
fiery seal
#

are u creating the weld locally?

olive pumice
#

Is it possible for you to show me the full script and the location of it?

fiery seal
#

in a localscript?

undone bear
#

Server script (p1)

-- services

local Players = game:GetService("Players")
local RS = game:GetService('ReplicatedStorage')

-- events
local WeaponEvent = RS.Remotes.Combat.WeaponEvent

-- folders
local Models = RS.Models
local WeaponModels = Models.Weapons
local WeaponWeld = script.Welds.Weapons

-- objects
local welds = {}
local welds2 = {}
------------------------------------------------------

Players.PlayerAdded:Connect(function(player)
    
    player.CharacterAppearanceLoaded:Connect(function(Char)
        local LeftHand = Char["Left Arm"]
        local RightArm = Char["Right Arm"]
        
        Char:SetAttribute("Equipped", false)
        
        local Katana = WeaponModels.Sword:Clone()
        Katana.Parent = Char
        
        welds[player] = WeaponWeld.Katana.SeatheWeld -- idle
        welds[player].Parent = LeftHand
        welds[player].Part0 = LeftHand
        welds[player].Part1 = Katana

        --[[local Weapon = Seathe.Sword:Clone()
        Weapon.Parent = Seathe]]

        --[[local weld = Instance.new("Weld", Seathe)
        weld.Part0 = Seathe
        weld.Part1 = Weapon
        weld.C1 = CFrame.new(-0.013, 0, -0.85)]]
        
        local Seathe = WeaponModels.Seathe
        Seathe.Parent = Char
        
        --[[welds2[player] = WeaponWeld.Katana.SeatheWeld
        welds2[player].Parent = LeftHand
        welds2[player].Part0 = LeftHand
        welds2[player].Part1 = Seathe
        welds2[player].C0 = welds2[player].Part0.CFrame:ToObjectSpace(LeftHand.CFrame)]]
    end)
    
end)
#

serverscript pt2

Players.PlayerRemoving:Connect(function(player)
    -- removes weld from the player when leaving
    if welds[player] then 
        table.remove(welds, table.find(welds, welds[player]))
    end
    
end)

WeaponEvent.OnServerEvent:Connect(function(plr, action)
    local char = plr.Character
    local humanoid = char.Humanoid
    local LeftHand = char["Left Arm"]
    local RightArm = char["Right Arm"]
    --local Katana = Weapons.Sword
    
    if action == "Equip/Unequip" and not char:GetAttribute("Equipped") then --equipping
        char:SetAttribute("Equipped", true)
        
        welds[plr].Part0 = RightArm
        welds[plr].C1 = WeaponWeld.Katana.SeatheWeld.C1 -- holding

    elseif action == "Equip/Unequip" and char:GetAttribute("Equipped") then --equipping
        char:SetAttribute("Equipped", false)
        
        welds[plr].Part0 = LeftHand
        welds[plr].C1 = WeaponWeld.Katana.KatanaWeld.C1 -- holding
    end
    
end)
exotic wasp
olive pumice
undone bear
#

ah

#

nvm

olive pumice
#

Bro

#

Lmfao

undone bear
#

thought he was referring to weaponevent

olive pumice
#

Okay are you still in the studio

undone bear
#

mhm

olive pumice
#

Can you play it

cold stratusBOT
#

studio** You are now Level 1! **studio

olive pumice
#

The scenario where the bug occours

#

Seitch ti server side on the menu at the top

#

And check if the weld is at the location

#

Cause if its not then somethings changing Its location.

#

And making the script unable to find it

undone bear
olive pumice
undone bear
#

i mean it shows both welds

#

sever and client

#

ah

#

i see it now

olive pumice
#

?

undone bear
#

it doesn't occur once i switch weapons

#

this is me playing the game

#

SeatheWeld doesn't even create

olive pumice
#

Thats the server or the client side

undone bear
olive pumice
#

So It isnt there on the server side when u play

olive pumice
undone bear
olive pumice
#

Then there you have it I guess

#

Issue found

#

Hooray

undone bear
#

not really

#

the issue now is implenting an instance so that it can be a valid member inside of the same folder as KatanaWeld

olive pumice
#

Just use Instance.new()

#

Cayse

#

Im just too lazy to think of something optimal

#

Its 2 am lmao

#

Like

undone bear
#

go to sleep bro

olive pumice
#
local newWeld = Instance.new("Weld")
newWeld.Parent = game.ServerScriptService.Welds.Weapons.Katana
#

Later