Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How Can I Make A Script That Make The Model Appear At A Certain Time?

Asked by
ImfaoXD 158
8 years ago

How can I be able to make a script that make a model that appear in a certain of time? For example; lets say that I made a cave and I placed it in lighting. And if it turn night time, then the cave will appear into the map with the position that I placed. How can I do that? Can somebody help me?

1 answer

Log in to vote
1
Answered by
Chronomad 180
8 years ago

This sounds like a job for .Changed and :SetPrimaryPartCFrame

local Time = game.Lighting
    local Model = game.Lighting.Z  --- Your Model

Time.Changed:connect(function()     ---Fires when properties of lighting are changed
    if Time.TimeOfDay == "14:00:00" then  --Desired time
        Model.Parent = game.Workspace -- Place the model in the workspace
        Model:SetPrimaryPartCFrame(CFrame.new(1,10,1))  ---The desired Position of the model
    end
end)

Hope this helps. Be sure to actually SET a primary part (In the properties of the model)

0
Tested this just now and it works. Chronomad 180 — 8y
0
It's not working. :( And what can I do if there is a model that group together? ImfaoXD 158 — 8y
0
Wait, do I put the script inside of the model as well? or no? ImfaoXD 158 — 8y
0
Is your Model either anchored or welded together? And did you set a primary part for the model? The script can be placed in the workspace. Chronomad 180 — 8y
Ad

Answer this question