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

Why Won't THIS work?![SOLVED]

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

0
I believe LocalPlayer must have a capital L at the beginning? Maybe? SanityMan 239 — 10y
0
LocalPlayer and localPlayer do the same thing. EzraNehemiah_TF2 3552 — 10y
0
Is CameraMode a property of Player? I thought it was CurrentCamera or something. SanityMan 239 — 10y
0
CurrentCamera is in workspace, I think. I checked and CamreaMode is in the player. EzraNehemiah_TF2 3552 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

Is there any output?

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

0
Nope, won't work... EzraNehemiah_TF2 3552 — 10y
0
BTW there is no output I think. EzraNehemiah_TF2 3552 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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)
0
How would you put that into my script? EzraNehemiah_TF2 3552 — 10y

Answer this question