Hello, I am trying to get it, but its not really working for me.
I am getting infinite yield everytime I die. Well, when I am spawning in at first everything is working fine, but when I reset it just says on the output, “infinite yield possible”
local saber = chr:WaitForChild("Lightsaber")
Thats the line where I have the problem. The character loads fine, but this is making it worse.
The saber spawns in before that line. I even checked the workspace if the player has the lightsaber on him, I even added wait before the line and still, infinite yield.
saberevent:FireServer()
--HumanBodyParts
local head = chr:WaitForChild("Head")
local torso = chr:WaitForChild("Torso")
local rarm = chr:WaitForChild("Right Arm")
local larm = chr:WaitForChild("Left Arm")
local rleg = chr:WaitForChild("Right Leg")
local lleg = chr:WaitForChild("Left Leg")
local human = chr:WaitForChild("Humanoid")
local hrp = chr:WaitForChild("HumanoidRootPart")
--
local animate = chr:WaitForChild("Animate")
local saber = chr:WaitForChild("Lightsaber")
Server script:
function weld(chr, saber, holster)
local weld = saber.Handle.Handle
weld.Parent = chr:WaitForChild("Right Arm")
weld.Part0 = chr:WaitForChild("Right Arm")
weld.Part1 = saber.Handle
local holsterweld = holster.Handle.Handle
holsterweld.Parent = chr:WaitForChild("HumanoidRootPart")
holsterweld.Part0 = chr:WaitForChild("HumanoidRootPart")
end
game.ReplicatedStorage.Saber.Saber.OnServerEvent:Connect(function(plr)
local chr = plr.Character
local saber = game:WaitForChild("ServerStorage").Lightsaber:Clone()
local holster = game:WaitForChild("ServerStorage").Holster:Clone()
holster.Parent = chr
saber.Parent = chr
weld(chr, saber, holster) -- WELDING