#Need help with a script
1 messages · Page 1 of 1 (latest)
i want to make the text above the portals dissapear depending on how far you are from it
local Workspace = game:GetService("Workspace")
local player = Players.LocalPlayer
local portals = Workspace.Portals
local portal1 = portals:WaitForChild("Portal1")
local portal2 = portals:WaitForChild("Portal2")
local portal3 = portals:WaitForChild("Portal3")
local portal1Gui = portal1:FindFirstChild("BillboardGui")
local portal2Gui = portal2:FindFirstChild("BillboardGui")
local portal3Gui = portal3:FindFirstChild("BillboardGui")
local ACTIVATION_DISTANCE = 75 -- studs
local CHECK_INTERVAL = 0.3 -- seconds between distance checks
if not portal1Gui or not portal2Gui or not portal3Gui then
warn("Could not find BillboardGui on Portals")
return
end
local function getCharacterPosition()
local character = player.Character
if character then
local hrp = character:FindFirstChild("HumanoidRootPart")
if hrp then
return hrp.Position
end
end
return nil
end
local function getPortalPosition()
local portal1Pos = portal1.Position
local portal2Pos = portal2.Position
local portal3Pos = portal3.Position
while task.wait(CHECK_INTERVAL) do
local playerPos = getCharacterPosition()
local portalPos = getPortalPosition()
if playerPos and portalPos then
local distance = (playerPos - portal1Pos).Magnitude
portal1Gui.Enabled = distance <= ACTIVATION_DISTANCE
local distance = (playerPos - portal2Pos).Magnitude
portal2Gui.Enabled = distance <= ACTIVATION_DISTANCE
local distance = (playerPos - portal3Pos).Magnitude
portal3Gui.Enabled = distance <= ACTIVATION_DISTANCE
else
portal1Gui.Enabled = false
portal2Gui.Enabled = false
portal3Gui.Enabled = false
end
end
end```
this is the script i wrote
billboardgui.MaxDistance=number
don't even need any code for it 
also dont use studio assistant
just ever
roblox is trying to force AI slop
dont use it
I reccomend gemini, but only use it as an assistant!!!!!
It has helped me build my game, but I reccomend to not become dependant and try to do it by your own, it will feel much more rewarding
not rewarding
you never learn with it
and the game can fail really easily
Yes that's why i dont let it EVER touch my code
because it has ruined one of my projects, I just use it to read my code, to check what is wrong with it when I cant, like when I put WorkSpace instead of workspace
things like that
now i gtg goodbye yall
U don't really need any scripts for it, u can just change the properties of the Billboard 🙂
He said help
Some times you need help from an Ai
human help will go better
and honestly if you use an ai for help probably use chatgpt instead