This is my script. Thanks:
local Player = game.Players.LocalPlayer
local char = Player.Character
local den = true
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.Q then
if not den then return end
den = false
local Part = Instance.new("Part")
Part.Parent = workspace
Part.CFrame = char.Head.CFrame * CFrame.new(0,0,-5)
wait(3)
den = true

2 comments
I don't understand your question or your problem. Please explain thoroughly what your problem is.
Do you mean they cant move while pressing “Q”? You could temporarily set walkspeed to 0 or Platformstand them...