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

How do I make touch trigger bridge?

Asked by 4 years ago

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

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

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)
0
Thank you I have One question though. What do you mean by define the model that is the bridge Scallywagpugzy 0 — 4y
0
I mean that, you define all the parts that make up the bridge so that all of it become transparent/opaque at once Lightning_Game27 232 — 4y
0
Ok thanks but how should it look like when I type It out Scallywagpugzy 0 — 4y
0
I dont Wanna type it the wrong way when I’m defining the parts Scallywagpugzy 0 — 4y
0
If you have many parts in your bridge, then I would just define each part and connect it all in one function. Lightning_Game27 232 — 4y
Ad

Answer this question