So, i recently learned about magnitude. I wanted to challenge myself, but it does not work considering I've used a long time on it.
There is an error: Players.maxpax2009.PlayerScripts.ShowGUI:4: attempt to index nil with 'FindFirstChild'
This is a local script by the way!
Here's the Local Script:
local Player = game.Players.LocalPlayer
local AggroDist = 10
local Character = game.Workspace:FindFirstChild(Player.Parent)
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
local GUI = game.Workspace.Cannon.GUIShow
if (HumanoidRootPart.Position - game.Workspace.Cannon.GUIShow.Position).magnitude < AggroDist then
GUI.BillboardGui.Enabled = true
end
Thanks for taking your time

1 comment
Question: why are you searching game.Workspace for the player's parent (game.Players)? I'd say change line 3 to game.Workspace:FindFirstChild(Player.Name)