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
5 years ago

Script:

01local player = game.Players.LocalPlayer
02local mouse = player:GetMouse()
03local rasengan = game.Lighting.Rasengan
04local copy = rasengan:Clone()
05local toggle = false
06 
07mouse.KeyDown:connect(function(key)
08    if not toggle and key == "r" then
09    rasengan.Parent = player.Character
10        local weld = Instance.new("Weld",player.Character["RightHand"])
11        weld.Part0 = rasengan -- this is the source of the problem
12        weld.Part1 = player.Character["RightHand"]
13        weld.C0 = weld.C0 * CFrame.new(0, 0, 0)
14        toggle = true
15    end
16end)

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 5 years ago
Edited 5 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