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

How do you make a transparent block reveal itself when touched?.

Asked by 11 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

I need help with this im making a fun game for robloxians like a magical world based on the anime Fairy tail : Rising Magic and im not sure how to Make a see-through block reveal itself by being touched.

0
Thanks alot Extreme2219 0 — 11y

5 answers

Log in to vote
0
Answered by
Sublimus 992 Moderation Voter
11 years ago

@above that will run when anything touches it, not just a human

1script.Parent.Touched:connect(function(hit)
2    if hit.Parent:findFirstChild("Humanoid") then
3        script.Parent.Transparency = 0
4    end
5end)
0
He asked when touched, he never specifically stated whether that should be a person or something else. TheMyrco 375 — 11y
Ad
Log in to vote
1
Answered by
TheMyrco 375 Moderation Voter
11 years ago

This script should be put inside the part in order to work.

1script.Parent.Touched:connect(function(p)
2    script.Parent.Transparency = 0
3end)
Log in to vote
0
Answered by
duckwit 1404 Moderation Voter
11 years ago

Roblox features event-based programming, so what you need to do here is 'listen' for the 'Touched' event - this is an event for all Part Instances and it 'fires' (runs) when something touches it.

1part = script.Parent --This script goes inside the part
2 
3function OnTouched()
4    part.Transparency = 0 --Set the transparency to 0
5end
6 
7part.Touched:connect(OnTouched) --Connect the function above to the "Touched" event
Log in to vote
0
Answered by 11 years ago
1script.Parent.Touched:conncet(function(player))
2x = game.Players:GetChildren()
3for i = 1, #x do
4if x[i].Name == player then
5script.Parent.Transparency = 0
6end
7end
8end)
Log in to vote
0
Answered by 6 years ago

Put this is the part you want to turn visible

1script.Parent.Touched:Connect(function(hit)
2if hit.Name == "PutPartNameHere" then
3script.Parent.Transparency = 1
4end)

Answer this question