Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

4 comments

0

Tested this just now and it works.

0

It's not working. :( And what can I do if there is a model that group together?

0

Wait, do I put the script inside of the model as well? or no?

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.