New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
0

# How to fix Model not cloning into camera using tool?

Hi,I recently asked a question where my script didnt work for some reason,even after solution it didnt work. So when I rewrite the script I discovered the problem which is this

local ReplicatedStorage = game.ReplicatedStorage
local V_tool = ReplicatedStorage.v_Tool
local Tool = script.Parent

Tool.Equipped:Connect(function()
V_tool:Clone().Parent = workspace.CurrentCamera
end)



I used even functions

local ReplicatedStorage = game.ReplicatedStorage
local V_tool = ReplicatedStorage.v_Tool
local Tool = script.Parent

Tool.Equipped:Connect(function()
CloneToCamera()
end)

function CloneToCamera()
V_tool:Clone().Parent = workspace.CurrentCamera
end



It still doesnt work so I'm confused.

0

0

So I figured it out!The problem was actually that I didn't put Handle to tool,well stupid me.

-2
Serpawh -4
3 months ago
Edited 3 months ago

We're making a function to just get the 'Tool' object itself.

local function findTool()
local V = game:GetService("ReplicatedStorage")['V_tool']
if V == nil then -- fix it;
else return V;
end

V_tool = findTool()
V_tool.Archivable = true
V_tool:Clone.Parent = game.Workspace.CurrentCamera
if assert(game.Workspace.CurrentCamera:FindFirstChild('V_tool') then
print"cloned"
else
V_tool:Clone().Parent = game.Workspace.CurrentCamera
end


Hello, there is a explanation for what I've done. When I looked up 'workspace' it said it had been deprecated from their servers, therefore, I use 'game.Workspace' in its stead.

Archivable is a property, inherited from Instance, that allows you to Clone something when it is true. It also allows your project to save that particular object.

I used assert() which is a function that checks if what you've put, is true or not. If it is then the if statement carries on like normal, but if it isn't then we included an else to repeat the earlier process of Cloning it.

I'm not sure what's after that...

0
Tried it and still it doesnt work wiktormont 14 — 3mo
0
Then you need to read out your console log. If there isn't an error, or warning, then you need to catch one like I tried doing. Serpawh -4 — 3mo
0
And because of you I lost some rep, so you're on your own bud. Serpawh -4 — 3mo
0
I didn't want man,there is no errors at all. wiktormont 14 — 3mo