#Everytime i try to equip, it keeps giving me a error
62 messages · Page 1 of 1 (latest)
giving an example
Try Katana:WaitForChild("SeatheWeld")
is WeaponWeld the Weapons folder
yep
tried that but keeps on giving me an infinite yield
are u creating the weld locally?
Is it possible for you to show me the full script and the location of it?
in a localscript?
server script
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)
what is the parent of weaponserver
SSS
thought he was referring to weaponevent
Okay are you still in the studio
mhm
Can you play it
** You are now Level 1! **
Shush
Play
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
is this a mistype?
Switch to server side on the tab at the top*
?
it doesn't occur once i switch weapons
this is me playing the game
SeatheWeld doesn't even create
Thats the server or the client side
server
So It isnt there on the server side when u play
Or that
yep
not really
the issue now is implenting an instance so that it can be a valid member inside of the same folder as KatanaWeld
Just use Instance.new()
Cayse
Im just too lazy to think of something optimal
Its 2 am lmao
Like
go to sleep bro