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!
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!
Try this:
game.Workspace.PartA.Touched:connect(function()
game.Workspace.PartB.Transparency = 1
end
Of course, change the parts' directories to their own.
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!
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
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.
2 comments
Can you post this script in a code block even if it does not work.
Try detecting the part via OnTouched, registering the 2 parts in the function.