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

I have a script which makes smoke disappear and reappear but it's not working. Can someone help?

I'm making a script which makes smoke disappear and reappear but it doesn't seem to work. Does any one know what I did wrong? My script is above.

local smoke = game.Workspace.Smoke

while true do
	wait (10)
	smoke.Opacity = 0.5
	wait (5)
	smoke.Opacity = 0
	wait(5)
end

I'm making a script which makes smoke disappear and reappear but it doesn't seem to work. Does any one know what I did wrong? Here's my script:

6 comments

0

Maybe it is changing but you're not noticing it. Try using print(smoke.Opacity) to check if it really works or not.

0

In the output it says "Smoke is not a valid member of workspace" and then I change it to local smoke = game.Worspace.Parent.Smoke and then it says "smoke is not a valid member of DataModel" I'm pretty new to scripting so idk what that means.

0

when you say workspace.Parent your referring to the parent of the workspace, which is the game, or, datamodel

0

I tried game.workspace.smoke.parent but it didn't work how would I make it so I'm talking about the smoke itself it's in a part so would I do game.workspace.part.smoke? I'm sorry if it seems really weird to ask things like this I'm new.

0

ok ive edited my answer

0

i wish i could downvote this

1 answer

✓ Accepted answer

so since all of this hasnt worked, here's a new way. Put the script inside of the smoke and copy and paste this new code.

local smoke = script.Parent

while wait(10) do
smoke.Opacity = 0.5
print(smoke.Opacity) -- like rabbi99 said, print opacity to see if it works
wait(5)
smoke.Opacity = 0
wait(5)
print(smoke.Opacity)
end

if that doesn't work, make sure the smoke actually does exist, remember roblox lua is case sensitive

12 comments

0

When I click play in the output it says "Workspace.Part.Smoke.Script:9: Expected 'end' (to close 'do' at line 3),got

0

yes put an end sorry

0

huh, it worked for like 30 seconds but then it says in the output "Infinite yield possible on 'Workspace:WaitForChild("Smoke") and instead of red it's orange

0

yeah put FindFirstAncestor

0

okay

0

now it's saying Workspace.Part.Smoke.Script:4:

0

?

0

now it's saying Workspace.Part.Smoke.Script:4: attempt to index nil with 'Opacity'. I'm sorry if this is frustrating you D;

0

alright, if all of this hasnt worked, imma edit my answer rq

0

ok there

0

YAY TYSM :D

0

your welcome

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