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

How do you trigger a "cutscene" with a click detector?

Asked by 3 years ago

Ok, so. I haven't scripted alot but I am trying my best to learn scripting. I am a solo dev and I am making a game but I have no idea on how to script.

I made this script with help from another user it's not done but I don't know how to finish it.

local clickDetector = workspace.DoorBell.ClickDetector

function onMouseClick() workspace.CameraPart end

clickDetector.MouseClick:Connect(function(onMouseClick)

I want it so that when you click the door Bell you see the POV of a camera part for around 5-7 seconds. I'm sorry if it seems like I'm only trying to get scripts for free. I'd be greatfull if someone could just explain atleast how camera parts and click detectors work and also if I need to use any remote events or if I have to use any code like "WaitForChild" for my script to work for example. I think I can figure it out by myself but if not I'll just ask for help again.

0
What I meant by "I think I can figure it out by myself but if not I'll just ask for help again." is that I think I can figure out the rest only if I get an explonation . EMoreLikePp 1 — 3y

1 answer

Log in to vote
0
Answered by
jundell 106
3 years ago
Edited 3 years ago

Make sure you are using a LocalScript. You can set workspace.CurrentCamera’s CameraType to Scriptable and its CFrame to workspace.CameraPart.CFrame. If you literally means “5-7 seconds” then you can do task.wait(math.random(5, 7)), or just task.wait(6) for a 6 second wait. To fix the camera, set the CameraType back to Custom.

1
Oh wow, thank you for explaning it so well jundell! I'll try my best to figure out how to script it with this knowledge. EMoreLikePp 1 — 3y
0
No problem :) I would make you a simple script to guide you but I’m currently on mobile. jundell 106 — 3y
0
It's fine. But if you could mabye later give an example on how to use this code. I'm currently trying to figure it out by going to DevHub and youtube but none explain how to use 'em. EMoreLikePp 1 — 3y
0
When I get on my computer, I can help you. I’m more likely to respond on discord, if want you can add me: vroom#9330 jundell 106 — 3y
View all comments (2 more)
0
I’ll be on my computer in no more than 2 hours. jundell 106 — 3y
0
I sent you a friend request. Qweatak#3416 EMoreLikePp 1 — 3y
Ad

Answer this question