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

How Do I Make Something Appear At A Certain Time?? [closed]

Asked by 4 years ago
Edited 4 years ago

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!

0
I'd use raycasting long story short. maxpax2009 340 — 4y

Closed as Not Constructive by Leamir, cailir, JesseSong, JesseSong, and JesseSong

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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
Ad