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

My script works in Studio but not the base game itself?

Asked by 9 years ago
01script.Parent.MouseButton1Down:connect(function()
02bin = script.Parent
03 
04function Clicked()
05bin.Parent.Visible = false
06end
07bin.MouseButton1Down:connect(Clicked)
08    game.Players.LocalPlayer.CameraMaxZoomDistance = .5
09end)
10bin = script.Parent
11 
12function Clicked()
13bin.Parent.Visible = false
14end
15bin.MouseButton1Down:connect(Clicked)
16game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
17    game.Players.LocalPlayer.CameraMaxZoomDistance = 20
18end)

It's supposed to lock the player in first person when he clicks the "Play" button and make the menu disappear. The menu disappears, but the player is not locked in first person. Is there anything I can do to fix this script?

0
Read this. I'm 90% the solution to your problem is in it. https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online BlueTaslem 18071 — 9y
0
I read it. What would you recommend me to change in my script? MariusAurelius 85 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
  1. Make sure it's in the proper script, in that case try to put it in a 'LocalScript' if it is already then go to number 2.

  2. When you're In - Game try pressing F9 to open the console and you'll see the error there. if you're having problem with the "Character" then try

1player = game.Players.LocalPlayer
2repeat wait() until player.Character ~= nil
3-- scripts
4--ends
0
I put it in a local script and added the code, and it works! Thanks very much! MariusAurelius 85 — 9y
Ad

Answer this question