Insufficent permissions to set DevComputerMovementMode

Was currently making a “select team” script (on my own) and everything was fine, but i didn’t want the player to move when selecting so I put the DevComputerMovementMode to Scriptable, but something is making it break and i cant figure it out.

(local) script:

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()

local function CitizenClick()
		plr.Team = game.Teams.Citizen
	char.HumanoidRootPart.CFrame = workspace.CitizenSpawn.CFrame
	script.Parent.Enabled = false
	plr.DevComputerMovementMode = Enum.DevComputerMovementMode.UserChoice --i tried using enum to see if it solved anything
end

local function PoliceClick()

	plr.Team = game.Teams.Police
	char.HumanoidRootPart.CFrame = workspace.PoliceStation.PoliceSPawn.CFrame
	script.Parent.Enabled = false
	plr.DevComputerMovementMode = "UserChoice"
end


script.Parent.Citizen.MouseButton1Click:Connect(CitizenClick)
script.Parent.Police.MouseButton1Click:Connect(PoliceClick)

This only works in server scripts. I thought it was supposed to prevent exploiters from making their own movement system, but they already have access to the character’s physical properties, including position, so I’m not sure.

Nevertheless, you will have to use remote events, with a parameter for the new movement mode.

2 Likes

You need to use a server script with a remote, or this method:

local module = require(game.Players.LocalPlayer.PlayerScripts.PlayerModule)
local controls = module:GetControls()

controls:Disable() -- to disable
controls:Enable() -- to enable
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.