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

How do I make touch trigger bridge?

I have not attempted to do this specific script. I asked this question 2 days ago and nobody has replied since then. What I would Like to learn is when you step on a brick it triggers a bridge to appear to cross the river. That was the example.

1 answer

What you should do is fire an onTouched event when someone touches the part. Write down a local function that runs when the onTouched event is fired! Hopefully this helped.

local part = -- Define where the Part that should be touched is
local bridge = -- Define the model/part that is the bridge

local function onTouched()
	bridge.Transparency = 0 -- This makes the bridge visible
end

part.Touched:Connect(onTouched)

If you have multiple parts for your bridge, then:

local part = --Define the part that is touched to fire event
local bridgePart1 = -- Define first bridge part
local bridgePart2 = --Define second bridge part and so on...

local function onTouched()
	bridgePart1.Transparency = 0 -- Sets Transparency to Opaque
	bridgePart2.Transparency = 0
end

part.Touched:Connect(onTouched)

5 comments

0

Thank you I have One question though. What do you mean by define the model that is the bridge

0

I mean that, you define all the parts that make up the bridge so that all of it become transparent/opaque at once

0

Ok thanks but how should it look like when I type It out

0

I dont Wanna type it the wrong way when I’m defining the parts

0

If you have many parts in your bridge, then I would just define each part and connect it all in one function.

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