#Gui button to change cam type
85 messages · Page 1 of 1 (latest)
** You are now Level 9! **
it didint work when i clicked the button it just didint do anything
r u triggering the remotevent thooo
cuz the code u gave, is executing when remotevent is triggered
from server to client
well its a similar script to the one i used for the proximity prompt
i copied and pasted it into this one but changed a few things
your script is being executed when remoteevent is fired from server.
do you want it to be executed on press of a button?
yes
yes the local script is
alright so
Local button = script.Parent
button:Activated:Connect(function()
......
add the local button
and the button:activated - replace your 6th line with this
okay
.???
what
first of all
its local not Local
second
why are you using :Activated as a method
it should only have a dot not a colon
and third, proximityprompts use the .Triggered event
i cant tell what he is trying to do
why would there be a method on a method
p sure he has the localscript under button
and when button is pressed then do smth
maybe am i just dumb
Activated works fine tho no?
no
yes it supposed to change the camera type back to the default(player cam)
when i click the button
is the button a gui button
you gotta do smth like
button.MouseButton1click:Connect(function()
end)
if its a gui button
i swear Activated works too
yes
what about the event?
yeah looks like that works too
does it go right under?
where does this line go?
i guess somewhere near the end?
and then just make it change camera type inside of that funciton
replace this with what false gave you
okay
without the end) tho
and to set it back to normal its Enum.CameraType.Custom
at this point youre just making the script for them
local camera = game.workspace.CurrentCamera
local UIS = game:GetService("UserInputService")
local Camera1 = workspace.Cameras:WaitForChild("CamForDorm")
local player = game.Players.LocalPlayer
local ExitButton = script.Parent
ExitButton.MouseButton1Click:Connect(function()
script.Parent.MouseButton1Click:Connect(function()
if camera.CameraType == Enum.CameraType.Scriptable then
Camera1.CFrame = camera.CFrame
end
end)
end)
like this right?
so remove the second one?
uh yeah
so atp i dont even need an event?
yes?
but for some reason youre connecting the same event twice
inside the first one
local camera = game.workspace.CurrentCamera
local UIS = game:GetService("UserInputService")
local Camera1 = workspace.Cameras:WaitForChild("CamForDorm")
local player = game.Players.LocalPlayer
local ExitButton = script.Parent
ExitButton.MouseButton1Click:Connect(function()
if camera.CameraType == Enum.CameraType.Scriptable then
Camera1.CFrame = camera.CFrame
end
end)
it didint do anything