When you respawn, does your character create a new instant of itself? Let's take a radio gamepass for example. it executes perfectly when you first get into the game I am building, but when I reset or die, the radio falls off the character.

it is a r15 character based game and I am trying to figure things out. Should WaitForChild be FindFirstChild?

I know in the code goes like this [NOT my code]

return function(player)
	local function weldBetween(a, b)
    local weld = Instance.new("ManualWeld")
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = CFrame.new()
    weld.C1 = b.CFrame:inverse() * a.CFrame
    weld.Parent = a
    return weld;
	end
	local char = player.Character 
	local hand = game:GetService("ServerStorage"):WaitForChild("Radio"):clone()
	hand.Parent=char
	hand.CFrame=char:WaitForChild("UpperTorso").CFrame*CFrame.new(Vector3.new(0,0,1))*CFrame.Angles(0,math.rad(180),math.rad(45))
	weldBetween(char:WaitForChild("UpperTorso"), hand)
	hand.CanCollide=true
	hand.Anchored=false
	hand:WaitForChild("Radio").Parent=player:WaitForChild("PlayerGui")
end

1 comment

0

Try waiting for the character to load. :P local char = player.Character or player.CharacterAdded:Wait()