Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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)
0
what line is the error acediamondn123 147 — 3y
0
1 wyatt447 16 — 3y

2 answers

Log in to vote
0
Answered by
notfenv 171
3 years ago

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)
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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)

0
if so its saying line 2 has a error wyatt447 16 — 3y
0
with the same error : ServerScriptService.WeldSword:2: attempt to call a RBXScriptSignal value wyatt447 16 — 3y
0
Oops, make sure to add a Connect on each .thingy, e.g. .CharacterAdded:Connect(function(char). Sorry for the late reply. notfenv 171 — 3y

Answer this question