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

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

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

1 comment

0

Could you describe your problem more? Do you want to make a part go transparent, or all parts in a model?

2 answers

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)

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)

2 comments

0

ok

0

You didn't even use the debounce

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