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

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

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)

2 comments

0

"Monster1" remove the one 1 from the variable name

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

1 answer

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.

3 comments

0

Oh ye forgot lol, the problem is it won't show up when u touch the brick (MonsterShown)

0

Is the monsterShow defined in the script?

0

yes

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