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

How to make a part disappear after someone touches diffrent block?

Asked by 4 years ago
Edited 4 years ago

i'm new to scripting and i need a script that will make a block disappear after i touched the block i put the script in. Please use simpler terms since im very new and i dont undertstand everything. Thanks

0
Reply to your Private message: What do you want to make? Xapelize 2658 — 4y

2 answers

Log in to vote
1
Answered by
Xapelize 2658 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

Heya, let me tell you some simple steps here:

Steps

Insert 3 parts, and name those parts becomes 1, 2 and 3.

Insert an IntValue into the workspace. Also note, don't change the IntValue name.

How do we make these works

If you touched the part '1', then the value will become 1, and then make other parts become invisible.

If you touched the part '2', then the value will become 2, and then make other parts become invisible. And etc.

Script time!

Now it's script time, no more description here, let get right into the scripting time :P

Insert part '1', part '2' and part '3' this script:

script.Parent.Touched:connect(function(hit) -- this will give a event to server if you touched.
    workspace.Value.Value = script.Parent.Name -- make the IntValue's  value become the part's name, so that's why I tell you to change the part name lol
end)

Insert the IntValue a script:

while wait(.5) do -- update the script every 0.5 seconds.
if script.Parent.Value == 1 then -- if intvalue's value was 1
    game.Workspace["1"].Transparency = 0 -- set those part transparency
    game.Workspace["2"].Transparency = .5 -- if you want to make the part cleary invisible, set it to 1.
    game.Workspace["3"].Transparency = .5
end

if script.Parent.Value == 2 then
    game.Workspace["1"].Transparency = .5
    game.Workspace["2"].Transparency = 0
    game.Workspace["3"].Transparency = .5
end

if script.Parent.Value == 3 then
    game.Workspace["1"].Transparency = .5
    game.Workspace["2"].Transparency = .5
    game.Workspace["3"].Transparency = 0
end
 end

Ok, it's done. So anyways, comment below if you have a question, or PM me at ROBLOX. Thanks for seeing this answer! c:

Mark this as answer if that worked to you, I have some grammars problem, but it was 100% to work, if that doesn't work, also comment below too :D

Click this to the testing game!

So, I'm Jack_Roblox2008, cya tomorrow :)

the end (also note rip grammar teacher 2020 - 2020)

0
Please mark this as answer ;-; please c: Xapelize 2658 — 4y
0
Thanks it worked!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FastAsPOOtis 0 — 4y
0
I DONT EVEN SPEAK ENGLISH IRL I LEARNT IT THROUGH VIDEO GAMES XDXD FastAsPOOtis 0 — 4y
0
DUDDE WHEN IT DISAPPEARS I CANT GO THROUGH IT PLEASE HELPPPP FastAsPOOtis 0 — 4y
View all comments (6 more)
0
Make the all part cancollide become TRUEEEE Xapelize 2658 — 4y
0
or ill update my script Xapelize 2658 — 4y
0
wtf does that MMMEEEANN FastAsPOOtis 0 — 4y
0
Inside the properties window there is a property called `CanCollide` Turn the property off. royaltoe 5144 — 4y
0
do u have to make it that complicated for the newbie TNTIsLyfe 152 — 4y
0
Go to the properties, and there have a thing called CanCollide. Or you can use 'script.Parent.CanCollide = true' or 'script.Parent.CanCollide = false'  to toggle on and off the part throughable or not. Xapelize 2658 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Well, Jack's answer was right, but it's a little more complicated than I like. Here's how I would do it:

script.Parent.Touched:Connect(function()
game.workspace.Part2.Transparency = 1
end

A lot less code and much simpler.

0
Nice, I tried to use while wait(.5) do to update the script every 0.5 seconds but I didn't think might work too :P Thanks for the answer! I've learned how to post a simpler answer XD Xapelize 2658 — 4y

Answer this question