You need to parent the model when you're using this approach.
1 | if msg:lower() = = "tables" then |
2 | newmodel = game:GetService( "InsertService" ):LoadAsset( 382608241 ) |
3 | newmodel.Parent = game.Workspace |
4 | newmodel:MoveTo(Vector 3. new( 0 , 0 , 0 )) |
Also, I recommend replicating
(copying) the table from ReplicatedStorage
rather than insering it.
Another thing is, you need to be aware that this model is indeed free to access, otherwise you cannot use it in your game.
1 | if msg:lower() = = "tables" then |
2 | newmodel = game.ReplicatedStorage:FindFirstChild( "Table" ):clone() |
3 | newmodel.Parent = game.Workspace |
4 | newmodel:MoveTo(Vector 3. new( 0 , 0 , 0 )) |
Removing the table:
1 | if msg:lower() = = "no tables" and game.Workspace:FindFirstChild( "Table" ) ~ = nil then |
2 | game.Workspace:FindFirstChild( "Table" ):Destroy() |
Replace "Table" with the name of the inserted object.
Replacing the table:
I was thinking maybe I misunderstood the question so here's another view of what you MAY be asking for
1 | if msg:lower() = = "tables" then |
2 | if game.Workspace:FindFirstChild( "Table" ) ~ = nil then |
3 | game.Workspace:FindFirstChild( "Table" ):Destroy() |
6 | newmodel = game:GetService( "InsertService" ):LoadAsset( 382608241 ) |
7 | newmodel.Parent = game.Workspace |
8 | newmodel:MoveTo(Vector 3. new( 0 , 0 , 0 )) |
Replace Table with the name of the model.