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

What does "11:54:45.241 - Expected BasePart got Tool for Weld:Part0." mean and how do I fix it?

Asked by
AM910sk 22
4 years ago

Script:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local rasengan = game.Lighting.Rasengan
local copy = rasengan:Clone()
local toggle = false

mouse.KeyDown:connect(function(key)
    if not toggle and key == "r" then
    rasengan.Parent = player.Character
        local weld = Instance.new("Weld",player.Character["RightHand"])
        weld.Part0 = rasengan -- this is the source of the problem
        weld.Part1 = player.Character["RightHand"]
        weld.C0 = weld.C0 * CFrame.new(0, 0, 0)
        toggle = true
    end
end)

This script is used to equip a tool called rasengan from lighting and every time I try to use it the output says "11:54:45.241 - Expected BasePart got Tool for Weld:Part0."

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Your trying to set a weld to a part that is not an intstance, but a tool.

Also, you do not need to weld it to the hand. To place it in a players hand, parent it to the players character in Workspace. If you want it in their backpack, parent it to game.Players.Player.Backpack.

But if you still want to weld it, set it to the tools handle instead of the tool itself.

Ad

Answer this question