Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

attempt to call a RBXScriptSignal value, why is this happing?

I have no idea what's happening, can someone help? hear is my code:

game.Players.PlayerAdded(function(player)
	player.CharacterAppearanceLoaded:Connect(function(char)
		local h = game:GetService("ServerStorage"):FindFirstChild("KatanaModel"):Clone()
		if not char:IsA("Model") then return end
		
		local rHand = char:FindFirstChild("RightHand")
		h:SetPrimaryPartCFrame(rHand.CFrame * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)))
		
		local weld = Instance.new("Weld")
		weld.Part0 = rHand
		weld.Part1 = char
		
		weld.Name "HandleWeld"
		weld.Parent = rHand
		h.Parent = char
	end)
end)

2 comments

0

what line is the error

0

1

2 answers

✓ Accepted answer

You missed a connect on PlayerAdded. I also edited the code to utilise appearance loaded correctly, but you can change back if you want.


game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded(function(char)
		player.CharacterAppearanceLoaded:Wait()
		wait(0.1)
		-- do stuff
	end)
end)

so would it be:

game.Players.PlayerAdded:Connect(function(player)
	    player.CharacterAdded(function(char)
	        player.CharacterAppearanceLoaded:Wait()
	        wait(0.1)

            local h = game:GetService("ServerStorage"):FindFirstChild("KatanaModel"):Clone()
	        if not char:IsA("Model") then return end

	        local rHand = char:FindFirstChild("RightHand")
	        h:SetPrimaryPartCFrame(rHand.CFrame * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)))

	        local weld = Instance.new("Weld")
	        weld.Part0 = rHand
	        weld.Part1 = char
	 
	        weld.Name "HandleWeld"
	        weld.Parent = rHand
            h.Parent = char
       end)
end)

3 comments

0

if so its saying line 2 has a error

0

with the same error : ServerScriptService.WeldSword:2: attempt to call a RBXScriptSignal value

0

Oops, make sure to add a Connect on each .thingy, e.g. .CharacterAdded:Connect(function(char). Sorry for the late reply.

This discussion is preserved as it was. New answers, comments, and votes are closed.