local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if key == "v" then Player = script.Parent.Parent game.Workspace.WorkspaceRinkakuModel:MakeJoints() local WRM = game.workspace.WorkspaceRinkakuModel local RinkakuModel = WRM:Clone() RinkakuModel.Parent = workspace RinkakuModel.Name = Player.Name local w = Instance.new('Weld') w.Part0 = RinkakuModel w.Part1 = Player.Character.Torso w.Parent = RinkakuModel w.C0 = CFrame.new(0, 0, 0)*CFrame.new(0, 0, 0) end end)
This script should make a clone of WorkspaceRinkakuModel (Which Is In Workspace, Of Course) and weld it to my torso whenever I press V. But it doesnt seem to work and I dont know whats wrong with it, there are no visible errors and the script is a localscript in starterpack. Help please?
There are a couple of evident problems. First off, you use makejoints on the initial model whenever you press v instead of the clone. Makejoints should be called on the clone after creating the weld. You should also use debounce so that you can't repeatedly clone your model. It's probably also a good idea to parent the clone to the character instead of workspace, and you should consider putting the model to clone inside of ReplicatedStorage.
Finished Script
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local debounce = false Mouse.KeyDown:connect(function(key) if key == "v" and not debounce then debounce = true local RinkakuModel = game.ReplicatedStorage.RinkakuModel:Clone() --Assuming the model is now in ReplicatedStorage local w = Instance.new('Weld') w.Part0 = RinkakuModel.PrimaryPart w.Part1 = Player.Character.Torso w.Parent = RinkakuModel w.C0 = CFrame.new(0, 0, 0)*CFrame.new(0, 0, 0) RinkakuModel.Parent = Player.Character RinkakuModel:MakeJoints() RinkakuModel.Name = Player.Name end end)
Comment if the code doesn't work for you, and I'll see what I might've done wrong.