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

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

Asked by 7 years ago

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!

0
Can you post this script in a code block even if it does not work. User#5423 17 — 7y
0
Try detecting the part via OnTouched, registering the 2 parts in the function. Latine_Lemonade 15 — 7y

2 answers

Log in to vote
1
Answered by 7 years ago

Try this:

game.Workspace.PartA.Touched:connect(function()
game.Workspace.PartB.Transparency = 1
end
0
Of course, change the parts' directories to their own. sesamert16 31 — 7y
0
Doesn't work! :C ROLANBLOX 4 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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!

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 chess123mate 5873 — 7y
0
Oh...I see...I'll try my best to fix this!11 ROLANBLOX 4 — 7y

Answer this question