#door/part that slides up with the click of a button which is another part.
1 messages · Page 1 of 1 (latest)
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)
am i gonna get any help or
hi btw
Let me explain the sticker I posted: Please format your message so the script is easier to read
how do i format
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)'''
They're called back tics, to the left of the '1' on your keyboard.
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
So does this not move the door? Does it not play the sound but move the door? I need more details so I can better help you
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
Okay. What kind of script is it and where is it.
If you add a print statement, do you see anything in the output?
let me check the print rq, and its a regular script and i placed it inside the mouse click detector
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
Always look for errors when something doesn't work.
rbxassetid://1085369359 needs to be a string, so "rbxassetid://1085369359"
You can stop now
k
sigh
Sigh what
i just cant make this stupid script
Dude I literally told you what the error was, are you just not reading?
i just dont get it man
im not good at scripting
ive always been a builder/modeller
so
Take the text rbxassetid://1085369359 and put quotes around it so its "rbxassetid://1085369359" now
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
You know how you added the sound into the door in the Explorer?
actually i added the script with the sound into the button
Okay, that doesn't matter, you added a sound asset, the sound you added by taking it from the toolbox or adding it via the plus button on the door. That sound.
It has a property called "ID", place the asset ID there
like this?
** You are now Level 7! **
mee6 sthu
Yes. As long as the SoundId is set there, you can just do :Play().
No just like get rid of the string inside Play(), you don't need it anymore.
the "" right?
yes
Also, there are no variables called main_door or endpos_door so it's not gonna work
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
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
Okay I'd suggest using a tutorial then. That'd slowly describe to you how to do it, and you can learn by following along.