I want to be able to not make the part that I’m using W, A, S, D to move cancolide is on true for the walls and the parts
robloxapp-20210220-1505187.wmv (2.5 MB)
I don’t know what to do and here is the script I know it wouldn’t help much but here
Lua here
local UIS = game:GetService(“UserInputService”)
local movepart = game.Workspace.movepart
local stopA = false
local stopW = false
local stopS = false
local stopD = false
– W
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.W then
stopW = false
while wait() do
if stopW == false then
movepart.Position = movepart.Position - Vector3.fromAxis(Enum.Axis.Z)
print(movepart.Position)
end
end
end
end)
UIS.InputEnded:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.W then
stopW = true
end
end)
– S
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.S then
stopS = false
while wait() do
if stopS == false then
movepart.Position = movepart.Position + Vector3.fromAxis(Enum.Axis.Z)
print(movepart.Position)
end
end
end
end)
UIS.InputEnded:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.S then
stopS = true
end
end)
–A
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.A then
stopA = false
while wait() do
if stopA == false then
movepart.Position = movepart.Position - Vector3.fromAxis(Enum.Axis.X)
print(movepart.Position)
end
end
end
end)
UIS.InputEnded:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.A then
stopA = true
end
end)
– D
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.D then
stopD = false
while wait() do
if stopD == false then
movepart.Position = movepart.Position + Vector3.fromAxis(Enum.Axis.X)
print(movepart.Position)
end
end
end
end)
UIS.InputEnded:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.D then
stopD = true
end
end)