Hello everyone. I've made an automatic line/queue system that the player stands in and is automatically moved by a script. I've disabled the players movement controls to achieve this effect. The problem is that it's all over the place. Sometimes if you reset while the controls are disabled, you can't get them back. This is the code I'm using to disable them.
wait()
local player = game.Players.LocalPlayer
local character = player.Character
local walkable = character:FindFirstChild("Walkable")
while true do
wait()
if walkable then
if walkable.Value == true then
local Controller = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls()
Controller:Enable()
elseif walkable.Value == false then
local Controller = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls()
Controller:Disable()
end
character.Humanoid.Died:Connect(function()
local Controller = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls()
Controller:Enable()
end)
end
end
Thank you in advance, have a great day.
