So, there’s a custom proximity prompt system that I’m making.
There’s a localscript inside of the billboardgui that gets Enabled once the proximity prompt appears, and it should customize the appearance of proximity prompt based on the values of the thing that this proximityprompt is connected to.
The thing is - this script doesn’t seem to be working at all. I tried adding some print commands to the main loop to check when it works and when it doesn’t, but as it seems the script doesn’t work at all.
local HasPower, Tweaking, TextVal
local Text = script.Parent.Text.Textet
local Button = script.Parent.Button
local ButShadow = script.Parent.ButtonShadow
function SaveValues(Part)
Tweaking = Part:GetAttribute("Tweaking")
HasPower = Part:GetAttribute("HasPower")
TextVal = Part:GetAttribute("Text")
end
function randomLetter()
local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
local randomValue = math.random(1, #alphabet)
local letter = string.sub(alphabet, randomValue, randomValue)
return letter
end
-- WHY ISN'T THIS WORKING??? IS THERE SOMETHING MISSING? MUST MORE BLOOD BE SHED???
-- the constant loop is important to stay because the values of proximityprompt's systems change dynamically. that's the main reason as to why this is inside of a separate script in the first place.
while task.wait() do
local ParentPart = script.Parent.Parent.Parent
print(ParentPart:GetAttribute("Active"), ParentPart.Name)
if ParentPart:GetAttribute("Active") then
print("fuck yeah")
SaveValues(ParentPart)
if Tweaking == true then -- here it should change the looks of the billboardgui
Button.Text = randomLetter()
Button.TextColor3 = Color3.fromRGB(144, 81, 81)
ButShadow.Text = Button.Text
Text.Text = "ERROR"
else
if HasPower == true then
Button.Text = "E"
ButShadow.Text = "E"
Button.TextColor3 = Color3.fromRGB(144, 81, 81)
Text.Text = TextVal
else
Button.Text = "E"
ButShadow.Text = ""
Button.TextColor3 = Color3.fromRGB(72, 49, 49)
Text.Text = TextVal
end
end
end
end
The clone of a billboardGUI gets put inside of the Hitbox part by the main proximity prompt system that i made, then the same system enables this script that is located inside of the billboardGUI through ‘’.Enabled = true’’ command