Now, I understand that I can easily use a ParticleEmitter to gain this sort of effect. But it’s not the intended effect I’m going for.
For ParticleEmitters, the image is constantly faced towards the Client’s camera at all times, and I don’t want that. So I’m relying on the production of ImageLabels being constantly created in a loop.
local asset = "http://www.roblox.com/asset/?id=3060979090"
local function Splash()
local imagelabel = Instance.new("ImageLabel")
imagelabel.Image = asset
imagelabel.BackgroundTransparency = 1
imagelabel.ImageTransparency = .5
imagelabel.ImageColor3 = Color3.fromRGB(255,228,84)
local randomSize = math.random(1,3)
-- Determines the size of the image
if randomSize == 1 then
imagelabel.Size = UDim2.new(0.015,0,0.015,0)
elseif randomSize == 2 then
imagelabel.Size = UDim2.new(0.03,0,0.03,0)
elseif randomSize == 3 then
imagelabel.Size = UDim2.new(0.05,0,0.05,0)
end
-- Problem here
imagelabel.Position = UDim2.new(math.random(0.21,0.35),0,math.random(0.11,0.25),0)
imagelabel.Parent = script.Parent
for i = 50,1,-1 do
wait(.1)
imagelabel.ImageTransparency = imagelabel.ImageTransparency + .1
end
imagelabel:Destroy()
end
while true do
wait(.1)
Splash()
end
I know this is probably really bad for performance issues, and I might get shredded for that, but I did identify the problem which was this line:
imagelabel.Position = UDim2.new(math.random(0.21,0.35),0,math.random(0.11,0.25),0)
Every single time, this line tries to generate a random position, the ImageLabel’s position is always at the {0,0,0,0} origin. Why?
Also, the loop at the very bottom of the script is yielding for the function to finish before playing the function again. (So it would only generate one splash, wait for it to finish, then generate another one.) How can I get around that?
Sorry, I know this is a lot, (and most likely impractical,) I’m just having a difficult time trying to get around this.