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

how make transparent model when you touch block? (not model part) [closed]

Asked by 4 years ago
Edited 4 years ago

i noob in roblox lua and i can only change (local)script a bit to it start work =(

0
Could you describe your problem more? Do you want to make a part go transparent, or all parts in a model? Spjureeedd 385 — 4y

Closed as Non-Descriptive by Just2Terrify and hiimgoodpack

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

2 answers

Log in to vote
1
Answered by
herrtt 387 Moderation Voter
4 years ago
Edited 4 years ago

This here would only work for players (unlike ImAnons post) Change workspace.Part to your doors location.

local players = game:GetService("Players")

local part = workspace.Part
local w = false
part.Touched:Connect(function(hit)
    if w then return end
    if players:GetPlayerFromCharacter(hit.Parent) then -- Gotta check if it is a player touching
        w = true
        part.Transparency = .6
        wait(3)
        part.Transparency = 0
        w = false
    end
end)

(an upvote would be appreciated)

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

make sure you put script on the part not localscript because if you put localscript other peole can't see that its transparent. if this works please accept my answer! hope this help too!

local part = script.Parent
local debounce = true --for delay

part.Touched:Connect(function()
    if debounce == true then --if debounce = true then
        part.Transparency = 1 --part transparent to 1 you can change the value what you want
        wait(3) --wait 3 sec
        part.Transparency = 0 --part transparent to 0 so you can see it again
    end
end)
0
ok MagicPineappleLOLKA -6 — 4y
0
You didn't even use the debounce Spjureeedd 385 — 4y