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

Script for: If a part gets touched, then other part is now invisible???

So... Im trying to make a script but it doesnt work (Failed with no result)

Basicly, if a part A gets touched,then the part B gets invisible, but the part A is still visible! How to make that happen?

Please help, thanks!

2 comments

0

Can you post this script in a code block even if it does not work.

0

Try detecting the part via OnTouched, registering the 2 parts in the function.

2 answers

Try this:

game.Workspace.PartA.Touched:connect(function()
game.Workspace.PartB.Transparency = 1
end

2 comments

0

Of course, change the parts' directories to their own.

0

Doesn't work! :C

I tried to make a script (when part "TouchMe" gets touched, the Arrow fades away) and it looks like this...

wait(.2)
local a = game.Workspace.Arrow1.Arrow
TouchMe = script.Parent
function onTouch(Touched)
    if script.Parent:findFirstChild("Humanoid") then
        for i = 1, 50 do
            script.Parent.Transparency = a.Transparency-0.2
            wait(1) 
        end
    end
end
script.Parent.Touched:connect(onTouch)

..but that doesnt work! Please help!

2 comments

0

Does "Arrow" exist when this script starts running, or is Part1 something you fire Arrows at? Also, in your script, you don't use the "TouchMe" variable and on line 7 you mix "script.Parent" and "a" together. On line 8 you probably want "wait()" (if you really want 50 iterations, anyway), or note that your transparency change only needs 5 iterations to become invisible, not 50

0

Oh...I see...I'll try my best to fix this!11

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