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

Why is this simple and small camera mode script not working?

Asked by 5 years ago
Edited 5 years ago

--1 is LockFirstPerson and 0 is Classic

player = game.Players.LocalPlayer mouse = player:GetMouse()

mouse.KeyDown:connect(function(key) if key == "b" then if player.CameraMode == 1 then mouse.Icon = 'http://www.roblox.com/asset/?id=950896037' player.CameraMode = 0 elseif player.CameraMode == 0 then mouse.Icon = 'http://www.roblox.com/asset/?id=2570571375' player.CameraMode = 1 end end end)

0
lol format pls TheluaBanana 946 — 5y
0
Enums don't work that way... DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Both keydown() and connect() are deprecated, meaning you should not use them. Instead, use userinputservice or contextactionservice(https://developer.roblox.com/articles/Keyboard-Input-Methods). Instead of using connect(), use Connect()

0
That's not the problem. You should try actually looking at his code to see what is wrong. DeceptiveCaster 3761 — 5y
Ad

Answer this question