You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I would like to access the PlayerModule:GetControls() function. -
What is the issue? Include screenshots / videos if possible!
My script worked about 2 days ago. Today I packed the camera part into a new script and now I can’t access the PlayerModule:GetControls() function no more.
local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I checked the developer hub and found nothing that helped. I disabled all other scripts that got changed to check if any other scripts are affecting this by accident. Nothing worked so far.
Error Message:
Full Script (New Script):
local player = game:GetService("Players").LocalPlayer
repeat wait() until game:IsLoaded()
local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
controls:Disable()
game.StarterGui:SetCore("ResetButtonCallback", false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
Full Script (Old Script):
local player = game.Players.LocalPlayer
local defaultCam = game.Workspace.CurrentCamera
local partCam = game.Workspace:WaitForChild("CameraPart")
local viewCam = game.Workspace:WaitForChild("CameraViewport")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local tweenSettings = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
repeat
wait(1)
until game.Loaded
local controls = require(player.PlayerScripts.PlayerModule):GetControls()
controls:Disable()
repeat
defaultCam.CameraType = Enum.CameraType.Scriptable
wait(1)
until defaultCam.CameraType == Enum.CameraType.Scriptable
defaultCam.CFrame = viewCam.CFrame
game.StarterGui:SetCore("ResetButtonCallback", false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)