Answered by
5 years ago Edited 5 years ago
Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
We're making a function to just get the 'Tool' object itself.
01 | local function findTool() |
02 | local V = game:GetService( "ReplicatedStorage" ) [ 'V_tool' ] |
09 | V_tool.Archivable = true |
10 | V_tool:Clone.Parent = game.Workspace.CurrentCamera |
11 | if assert (game.Workspace.CurrentCamera:FindFirstChild( 'V_tool' ) then |
14 | V_tool:Clone().Parent = game.Workspace.CurrentCamera |
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...