For some reason certain conditional statements are tossing errors when performing otherwise standard operations under normal circumstances.
Basically
My if statements are searching for a handle in parts/tools that do not have a handle, and are attempting to compare positional values with tools to parts, where as tools do not hold a position. Ultimately erroring out and effectively breaking absolutely everything. I believe a Roblox update is to blame but if anyone knows a way to fix this, or if it's the fact I'm attempting to handle this on the client side. Please inform me.
RE.OnClientEvent:Connect(function(spawned)
for i,v in pairs(spawned) do
local x = PickupPrompt:Clone()
x.TextLabel.Text = "[F] Pick Up: "..v.Name
x.Parent = v
x.Enabled = true
game:GetService("UserInputService").InputBegan:Connect(function(input,gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.F then
if (player.Character.Torso.Position - v:FindFirstChild("Handle").Position).Magnitude < 10 then -- RUNS BOTH THIS
print("prolly gun")
elseif (player.Character.Torso.Position - v.Position).Magnitude < 10 then --AND THIS FOR ALL INDEXED INSTANCES
print("prolly mag")
end
end
end)
end
end)
