-
I would like to figure out how to run things if a object isn’t blocking something
Example:
-
What is the issue?
-
What solutions have you tried so far?
I’ve asked multiple Developers, tried looking on the devforum.
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
local Clone = script.Parent.Folder.Keys
local Clone1 = script.Parent.Folder.AP
local M = false
local AP = nil
local AdorneedDoor = nil
UserInputService.InputBegan:Connect(function(keycode,gp)
if gp then return end
if keycode.KeyCode == Enum.KeyCode.F then
if AdorneedDoor then
if Clone.Adornee == AdorneedDoor["Non-Tween"].Center then
AdorneedDoor.Main.RemoteEvent:FireServer()
end
end
end
end)
while wait() do
for i,v in pairs(game.Workspace.Doors:GetChildren()) do
if (v["Non-Tween"].Center.Position - Player.Position).magnitude <= 6 then
Clone.Adornee = v["Non-Tween"].Center
Clone.Enabled = true
AdorneedDoor = v
break
else
Clone.Adornee = script.Parent.Folder
Clone.Enabled = false
AdorneedDoor = nil
end
end
end