

local Part = script.Parent.TriggerPart -- First Image
-- script is the code holder
-- Parent means the thing that holds the script
-- script.Parent = Model
-- TriggerPart is inside the Parent
local Model = script.Parent.DestroyThisModel -- Second Image
Part.Touched:Connect(function(Hit) -- Check if something touch the trigger part
local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
if Player then -- Check if it is the player that touches it
Model:Destroy() -- Destroy the model for good
end
end)
sorry for the poor representation.
2 Likes
Meaning you’re going to make it non-collidable before the game starts, or after the player has touched the model?
If the former, then yes, you can do that and the script will continue to work.
Ok, thanks for the help. This should work.
Pretty easy. Even if you know nothing about scripting.
Now there are multiple ways of doing this.
But I will show you one of the easier ones.
game.Workspace.Model.Parent = game.Lighting
Now what this does is, it finds the Model in the workspace, and it changes it’s Parent to Lighting from workspace.
And because it is in the lighting, the model still will be there but the model will not be visible unless if you change its parent back to workspace.
Now for the certain point part, You can make it so when a player Touches a part in the Model, the model’s parent will be set to Lighting.
game.Workspace.Model.Part.Touched:Connect(function(hit) -- When something touches the part in the Model, this event will be fired.
if hit.Parent:FindFirstChild("Humanoid") then -- If theres a Humanoid in the object that touched the part.
game.Workspace.Model.Parent = game.Lighting
-- game.Workspace.Model:Destroy() (If you want to completely remove the model.)
end
end)
2 Likes