#door/part that slides up with the click of a button which is another part.

1 messages · Page 1 of 1 (latest)

delicate carbon
humble ether
#

oh mb

#

uh

#

this the code in the buton. local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0) -- you can modify it
script.Parent.MouseClick:Connect(function() -- fires when button clicked
local ts = tweenservice:Create(main_door, tweeninfo, {CFrame = endpos_door.CFrame}) -- create a tween
ts:Play() -- play the tween
script.Parent.Sound:Play(rbxassetid://1085369359) -- play the sound
end)

delicate carbon
humble ether
#

am i gonna get any help or

humble ether
delicate carbon
humble ether
#

how do i format

humble ether
#

how tf i do that

#

the 3 coma things

#

'''local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0) -- you can modify it
script.Parent.MouseClick:Connect(function() -- fires when button clicked
local ts = tweenservice:Create(main_door, tweeninfo, {CFrame = endpos_door.CFrame}) -- create a tween
ts:Play() -- play the tween
script.Parent.Sound:Play(rbxassetid://1085369359) -- play the sound
end)'''

delicate carbon
humble ether
#
local tweeninfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0) -- you can modify it
script.Parent.MouseClick:Connect(function() -- fires when button clicked
    local ts = tweenservice:Create(main_door, tweeninfo, {CFrame = endpos_door.CFrame}) -- create a tween
    ts:Play() -- play the tween
    script.Parent.Sound:Play(rbxassetid://1085369359) -- play the sound
end)```
#

there we go

delicate carbon
humble ether
#

wait let me check if it plays the sound

#

nope

#

actually nothing from the script works

#

i am pissed off

#

ive been at this for 2 hours

delicate carbon
humble ether
#

it says this

#

Workspace.Button.ClickDetector.Script:6: Expected identifier when parsing method name, got '//' - Studio - Script:6

#

ok ill just make this as simple as possible i think

delicate carbon
humble ether
#

the door

#

Ok

#

the door

#

is 2 parts

#

welded together and anchored

delicate carbon
#

You can stop now

humble ether
#

k

delicate carbon
humble ether
#

sigh

delicate carbon
humble ether
#

i just cant make this stupid script

delicate carbon
humble ether
#

i just dont get it man

#

im not good at scripting

#

ive always been a builder/modeller

#

so

delicate carbon
humble ether
#

ye i did

#

but sound still doesnt play

delicate carbon
# humble ether but sound still doesnt play

Okay now I see it. You're just misusing the sound. just do :Play() rather than giving it an ID. It should already have an ID when you created it. Place that ID in the object when you added the sound to the door

humble ether
#

id as in rbxassetid://

#

?

delicate carbon
humble ether
#

actually i added the script with the sound into the button

delicate carbon
humble ether
#

like this?

balmy forumBOT
#

studio** You are now Level 7! **studio

humble ether
#

mee6 sthu

delicate carbon
humble ether
#

like this?

#

do i replace the script to the door?

#

or keep it

delicate carbon
humble ether
#

the "" right?

delicate carbon
#

Also, there are no variables called main_door or endpos_door so it's not gonna work

humble ether
#

do i rename

#

let me show u the door

#

rq

delicate carbon
# humble ether do i rename

Well where are those things? It looks like the main door is the script's parent, so you'd need to store it.

local main_door = script.Parent

humble ether
#

some other guy tried helping but he just threw nonsense

#

he told me to make a clone of the dor

#

of where i wanted it to go

#

and make it transparency 100 and canconlide false

delicate carbon
humble ether
#

yeah i checked almost every video

#

all of them just have the same script

#

pressing the button and the door turns transparent

#

I give up