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

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

Asked by
ArCeMo6 -1
3 years ago
Edited 3 years ago

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:

0
Maybe it is changing but you're not noticing it. Try using print(smoke.Opacity) to check if it really works or not. rabbi99 714 — 3y
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. ArCeMo6 -1 — 3y
0
when you say workspace.Parent your referring to the parent of the workspace, which is the game, or, datamodel quinzt 201 — 3y
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. ArCeMo6 -1 — 3y
View all comments (2 more)
0
ok ive edited my answer quinzt 201 — 3y
0
i wish i could downvote this mrsgravy123 0 — 3y

1 answer

Log in to vote
0
Answered by
quinzt 201 Moderation Voter
3 years ago
Edited 3 years ago

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

0
When I click play in the output it says "Workspace.Part.Smoke.Script:9: Expected 'end' (to close 'do' at line 3),got <eof> ArCeMo6 -1 — 3y
0
yes put an end sorry quinzt 201 — 3y
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 ArCeMo6 -1 — 3y
0
yeah put FindFirstAncestor quinzt 201 — 3y
View all comments (8 more)
0
okay ArCeMo6 -1 — 3y
0
now it's saying Workspace.Part.Smoke.Script:4: ArCeMo6 -1 — 3y
0
? quinzt 201 — 3y
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; ArCeMo6 -1 — 3y
0
alright, if all of this hasnt worked, imma edit my answer rq quinzt 201 — 3y
0
ok there quinzt 201 — 3y
0
YAY TYSM :D ArCeMo6 -1 — 3y
0
your welcome quinzt 201 — 3y
Ad

Answer this question