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

Visible and invisible script doesn't work, can anyone help me?

Asked by 4 years ago

Hello i'm making a horror game and i have a monster that needs to be in it.

I came up with that when u touch a block the monster appears for 0.2 seconds (or something) then becomes invisible.

I'm no good scripter so for any good scripters this code is like weird, but can anyone fix this for me?

Monster1 = script.Parent

function getSpooky()
    Monster1.Transparency = 1
    wait(0.2)
    Monster1.Transparency = 0
end

MonsterShown.Touched:connect(getSpooky)
0
"Monster1" remove the one 1 from the variable name Lunaify 66 — 4y
0
I get what u mean, but the problem is i have a part and when u touch it it doesn't like go invisible DFROBUXX 28 — 4y

1 answer

Log in to vote
0
Answered by
Torren_Mr 334 Moderation Voter
4 years ago

You have the transparency messed up. 0 = visible 1 = invisible

Use this:

Monster1 = script.Parent

function getSpooky()
    Monster1.Transparency = 0
    wait(0.2)
    Monster1.Transparency = 1
end

MonsterShown.Touched:connect(getSpooky)

Also make sure the monster itself is invisible in the game.

0
Oh ye forgot lol, the problem is it won't show up when u touch the brick (MonsterShown) DFROBUXX 28 — 4y
0
Is the monsterShow defined in the script? Torren_Mr 334 — 4y
0
yes DFROBUXX 28 — 4y
Ad

Answer this question