#need help with a play button script

1 messages · Page 1 of 1 (latest)

pine cradle
#

got help from a tutorial and they didnt teach me how to make the play button work.. need help really, he told us this is all he'll show and to find out the rest by ourselves but no youtube tutorial is helping someone please help

glad fox
#

Hello my friend

#

What does the variable “PlayButton” refer to?

pine cradle
#

its just what the guy said to do

#

i have a text button tho

#

and its branched of a part

#

called

#

PlayPart

#

cuz its basicallty a 3D part

#

i tried to fix it and yeah that happened

hot berry
pine cradle
#

i mean i learnt how he did it throughout the tutorial although im new to scripting so not everything goes to my head like its common sense

#

so im not sure what to do now when theres no other tutorial that i foudn to help

pine cradle
hot berry
pine cradle
#

yeah idk what that means

#

bruh i only started scripting a week ago ive just been tryna script a bunch of different type of gui's to get the hang of it

#

but this is throwing me off

hot berry
pine cradle
#

yes

#

but u gaved me 1 word

hot berry
pine cradle
#

oh i misspelt it

autumn jungleBOT
#

studio** You are now Level 1! **studio

pine cradle
#

even so that doesnt fix my problem tho😭

#

i think

#

bc thats js the beginning

hot berry
# pine cradle i think

well the function is empty so it doesnt do anything yet..? maybe put a print in there to show it running

pine cradle
#

yeah i did thast

#

it works

#

but i want it to

#

like

#

yk how a normal gui works

#

but cuz this isnt in the startgui and im making a 3d gui

#

its completly different

#

so when i click play yk what i want to happen obviously but everything i do doesnt work

hot berry
pine cradle
#

let me shjow u what happened when i tried to fix it myself

#

the camera is completly off

#

ik its bc i put a camera there cuz its 3d but idk what to do

hot berry
#

either way you just need to reset what you did to the camera at the start of the script when the menu activates

#

like camera.type=custom camera.subject=localplayer.character.humanoid etc

#

obviously that's psuedocode so you'll have to google the correct names of those functions, i think you may only need to change the camera type, etc. heck maybe just google for resetting roblox camera to default. that seems to be all you will need there 👍

pine cradle
#

i asked google

#

and the Ai

#

gave me this script

#

local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local LocalPlayer = Players.LocalPlayer

local function ResetCamera()
local camera = Workspace.CurrentCamera
local character = LocalPlayer.Character or LocalPlayer.CharacterLoadingOrNotYetSet
local humanoid = character:FindFirstChildOfClass("Humanoid")

if camera and humanoid then
    camera.CameraType = Enum.CameraType.Custom
    camera.CameraSubject = humanoid
end

end

ResetCamera()

#

that is defo not it tho

#

nvm i got it iu think its this

hot berry
#

yea looks good put that in your play button etc so it resets the camera

pine cradle
hot berry
#

yep, that's what i meant by how easy it is to find some code to reset the camera, and there are a bunch of different ways to write it out, but the end result is the same.

pine cradle
#

yh icl theres defo some bug

#

nothing working

#

💀

#

or im just not doing it properly

#

let me just reset the whole script

fierce musk
#

can someone help me with a playbutton script with a camera?

autumn jungleBOT
#

studio** You are now Level 1! **studio