So it seems to only happen when I interact with something outside of the local environment but whenever I click to apply a change to my character my script will not enable my controls.

for i = 1,10 do
	wait()
	script.Parent.Blackout.BackgroundTransparency = script.Parent.Blackout.BackgroundTransparency - 0.1
end
repeat wait()
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
until workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = workspace.Preview.CFrame
workspace:WaitForChild(game.Players.LocalPlayer.Name):SetPrimaryPartCFrame(workspace.ClothesPreview.PrimaryPart.CFrame)
workspace:WaitForChild(game.Players.LocalPlayer.Name).Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=4562559724"
workspace:WaitForChild(game.Players.LocalPlayer.Name).Pants.PantsTemplate = "http://www.roblox.com/asset/?id=4562564556"
script.Uni.Value = "A"

repeat wait() until game.Players.LocalPlayer

local controls =require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
controls:Enable(false)

for i = 1,10 do
	wait()
	script.Parent.Blackout.BackgroundTransparency = script.Parent.Blackout.BackgroundTransparency + 0.1
end

script.Parent.Player.Confirm.Frame.TextButton.MouseButton1Click:Connect(function()
	controls:Enable(true) -- This is the problem
	repeat wait()
		workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
	until workspace.CurrentCamera.CameraType == Enum.CameraType.Custom
	game.ReplicatedStorage.UniformLocker.Wear:FireServer(script.Uni.Value) -- Disabling this fixes it, but I need this
end)

script.Parent.Player.ClassA.EquipButton.MouseButton1Click:Connect(function()
	workspace:WaitForChild(game.Players.LocalPlayer.Name).Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=4562559724"
	workspace:WaitForChild(game.Players.LocalPlayer.Name).Pants.PantsTemplate = "http://www.roblox.com/asset/?id=4562564556"
	script.Parent.Equip:Play()
	script.Uni.Value = "A"
end)

script.Parent.Player.ClassB.EquipButton.MouseButton1Click:Connect(function()
	workspace:WaitForChild(game.Players.LocalPlayer.Name).Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=4562560429"
	workspace:WaitForChild(game.Players.LocalPlayer.Name).Pants.PantsTemplate = "http://www.roblox.com/asset/?id=4562564556"
	script.Parent.Equip:Play()
	script.Uni.Value = "B"
end)

script.Parent.Player.ClassC.EquipButton.MouseButton1Click:Connect(function()
	workspace:WaitForChild(game.Players.LocalPlayer.Name).Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=4562561375"
	workspace:WaitForChild(game.Players.LocalPlayer.Name).Pants.PantsTemplate = "http://www.roblox.com/asset/?id=4562564556"
	script.Parent.Equip:Play()
	script.Uni.Value = "C"
end)

1 comment

0

I looked at the Control module. Enable doesn't return anything, therefor your controls variable is nil.  At line 25 you try to call a nil value. https://i.imgur.com/xGcA0dz.png