
https://gyazo.com/2676a20f891b9c468d8a864507492a45 --Replicated Storage
Alright so basically my "script" is basically when a player types "bb" then the Part should clone to the character but it doesn't.
Local Script
local ValuesFolder = script.Parent.Values
local AnimationsFolder = script.Parent.Animations
local Ball = script.Parent
local RS = game.ReplicatedStorage
local Player = game.Players.LocalPlayer
local Character = Player.Character
local function Weld(PartA,PartB)
local Weld = Instance.new("Motor6D")
Weld.Part0 = PartA
Weld.Part1 = PartB
Weld.C1 = CFrame.new(1.50002289, 0.000557899475, -1.40001571, -1, -2.7676856e-06, 3.0655814e-05, -3.06558977e-05, 3.01598648e-05, -1, 2.7667611e-06, -1, -3.01599503e-05)
Weld.Parent = PartA
end
local function onSpawnBall()
local ball = script.Parent.Parent
local newwball = ball:Clone()
Weld(Character.Torso, newwball)
newwball.Parent = Character
end
script.Parent.SpawnBall.OnClientEvent:Connect(onSpawnBall)
Server Script
local Ball = script.Parent
local RS = game.ReplicatedStorage
local function Weld(PartA,PartB)
local Weld = Instance.new("Motor6D")
Weld.Part0 = PartA
Weld.Part1 = PartB
local StartPosition = CFrame.new(PartA.Position)
local C0 = PartA.CFrame:inverse()*StartPosition
local C1 = PartB.CFrame:inverse()*StartPosition
Weld.C0 = C0
Weld.C1 = C1
Weld.Parent = PartA
end
local function playerAdded(player)
player.Chatted:Connect(function(msg)
if msg == "bb" then
script.Parent.SpawnBall:FireClient(player)
print("Fired")
end
end)
end
game.Players.PlayerAdded:Connect(playerAdded)

1 comment
put the ball in lighting instead and it should work (given that u edit the script for it too)