Answered by
6 years ago Edited 6 years ago
im not so sure of what you want, but if you'd want to check the magnitude between each value in the array and the player's character you can iterate through the array. also you should be using local variables as the variable defined as the array is on the highest scope.
01 | local thing = game.Workspace.E |
02 | local array = { m.Circle, m.hallleave } |
03 | local UIS = game:GetService( "UserInputService" ) |
05 | UIS.InputBegan:Connect( function (key) |
06 | if key.KeyCode = Enum.KeyCode.E then |
08 | for _,v in pairs (array) do |
09 | local distance = (game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.Position - v.CFrame.Position).magnitude |
11 | if distance < = 15 then |
12 | print ( "Test Succesful" ) |
generic for loops