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

Transparent on touch, but only for the individual and only till he leaves the server?

Asked by 6 years ago

Hi!

I would like to have a part in my game which disappears on touch (including the decals!). The thing is that I want it to be invisible for only the person who touched it, and not the entire server. The part plus its decals should be visible till it's touched, and only becomes visible again once the toucher rejoins the server.

Being the amateur scripter that I am, I got some help writing this script (yeah, I can't even do this alone, ha!):

brick = game.Workspace.transparentbrick

function onTouch(part)
    brick.Transparency=1
    wait(1)
    brick.Transparency=0
end

brick.Touched:connect(onTouch)

Is there a way to achieve this goal of mine?

Thanks in advance!

2 answers

Log in to vote
0
Answered by 6 years ago

Hello, there is a property (not sure for parts but 100% for UIs) called Adornee. Check to see if that is a property for the part then you will want to 'Adornee' that part to the player that touched it.

Ad
Log in to vote
0
Answered by 6 years ago
script.Parent.Touched:connect(function(TouchedPart)
    if part.Parent.Name == game.Players.LocalPlayer.Name then
        brick.Transparency=1
    end
end

Put a LocalScript in the brick.. and it should be fine.. If the person touches it it gets invisible and if he rejoins the game it is visible again (But this is only for Filtering-Enabled ON) Since a LocalScript cant change values for the whole server this only changes it for that person + if he/she rejoins its normal again cause it whas only invisible on his client.

Answer this question