Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why Won't THIS work?![SOLVED]

It just started working again... Out of nowhere...

4 comments

0

I believe LocalPlayer must have a capital L at the beginning? Maybe?

0

LocalPlayer and localPlayer do the same thing.

0

Is CameraMode a property of Player? I thought it was CurrentCamera or something.

0

CurrentCamera is in workspace, I think. I checked and CamreaMode is in the player.

2 answers

Is there any output?

Also, sometimes KeyDown() doesn't work too well. Switch it with KeyUp() just to see if anything happens.

2 comments

0

Nope, won't work...

0

BTW there is no output I think.

Try instead of string.byte(key) == 27 do key:lower() == string.char(27), and try adding a repeat loop, for instance, repeat wait(0)until game.Players.LocalPlayer and game.Players.LocalPlayer:GetMouse(), that will keep repeat waiting until those two are not equal to nil.

Edited: Your script will turn out something like this;

repeat wait(0)until game.Players.LocalPlayer and game.Players.LocalPlayer:GetMouse()
MyMouse = game.Players.LocalPlayer:GetMouse()
Player = game.Players.LocalPlayer
MyMouse.KeyDown:connect(function(key)
if key:lower() == string.char(27) then
script.Parent.Frame.Visible = true
script.Parent.TextLabel.Visible = false
script.Parent.Frame.Play.Script.Disabled = false
Player.CameraMode = "Classic"
end
end)

1 comment

0

How would you put that into my script?

This discussion is preserved as it was. New answers, comments, and votes are closed.