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

How would I go about making certain objects appear at the same and certain time?

Asked by 7 years ago
Edited 7 years ago

What I am trying to do is if two or more objects hold the same 'value' (seconds), they should appear, or in this case, come down at the same `time'. I am almost happy with the result but it is not quite there, yet. Both the module and localscripts are provided below

ModuleScript

001--Module: Map_Encoded
002--This is in the module. I provided 100 objects as my module holds more than 1,000
003return {--[[
004     Position,  Seconds]]
005[1] = {0.063, 0.4811924769908},
006[2] = {0.126, 0.4811924769908},
007[3] = {0.252, 0.4811924769908},
008[4] = {0.063, 0.6952781112445},
009[5] = {0.252, 0.6952781112445},
010[6] = {0.126, 0.9093637454982},
011[7] = {0.252, 0.9093637454982},
012[8] = {0.063, 1.124449779912},
013[9] = {0.252, 1.124449779912},
014[10] = {0.126, 1.3385354141657},
015[11] = {0.252, 1.3385354141657},
View all 102 lines...

LocalScript

01local map_encoded = require(script.Parent:FindFirstChild("Map_Encoded") or script.Parent:WaitForChild("Map_Encoded"))
02local note_i = 1 --Although not necessary, but helps when "note[2] (0.481) hits"
03 
04function create_note(pos)
05    local note = Instance.new("ImageLabel");
06    note.Size = UDim2.new(0.063, 0,0.011, 0);
07    note.Position = UDim2.new(pos, 0, 0, 0);
08    note.BorderSizePixel = 0
09    note.ZIndex = 3
10    note.BackgroundColor3 = Color3.new(255/255, 255/255, 255/255)
11    note.Parent = script.Parent
12end
13 
14local start_tick = tick() --Usually left as "nil" but when the function is called the 'tick' would be set.
15for i = 1, #map_encoded * #map_encoded --[[Decided to multiply so it can at least last]] do
View all 33 lines...

I do have an old method way of doing this but that method is inefficient, performance wise. Showing another method would be nice as this was the only thing I could think of.

0
Do you not know what 255/255 is? You should know, it is not necessary. Do you know what Color3.fromRGB is? hiimgoodpack 2009 — 7y
1
They both work. It's really just developer preference Thundermaker300 554 — 7y

Answer this question