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

How Do I Make Something Appear At A Certain Time??

Hello,

I am making a theme park game for Roblox and one of the biggest problems is that I do not know how to make something appear at a certain time. What I am trying to say is that when the roller coaster starts and when the roller coaster cart comes to a certain point, I want something to happen, maybe a light flicker or anything, but I do not know how to do so! I need help!

1 comment

0

I'd use raycasting long story short.

1 answer

✓ Accepted answer

Okay, so about the light flickering stuff.

Create a part and insert a pointlight in it, name the part; "Light"

Create another part on the other side of the rail track, name it RayPart

Create a serverscript in serverscriptservice

local LightPart = game.Workspace.Light
local RayPart = game.Workspace.RayPart

OriginalRange = LightPart.PointLight.Range

local myfirstray = Ray.new(LightPart.Position, LightPart.Position - RayPart.Position.Unit*500) -- creates a ray from the light to the part

local PartsToIgnore = {} -- the parts you want to ignore

while wait(0.1) do
	local hit, pos = workspace:FindPartOnRayWithIgnoreList(myfirstray, PartsToIgnore)
	
	if hit and hit.Name == "Coaster" then
		print("The coaster arrived!")
		LightPart.PointLight.Range = 0
		wait(0.2)
		LightPart.PointLight.Range = OriginalRange
	end
end

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