I have a simple script written. Its purpose is not relevant beyond the point that, when a proximity prompt is triggered, the BuildingGui below should enable.
The issue here is that the script works just fine the first time it’s used, but the second time the GUI fails to enable (it has been disabled by another script in the interim). Despite returning that it is enabled, a quick look at the explorer proves otherwise and the GUI functions perfectly fine once I manually enable it again through the explorer.
local Prompt = script.Parent.PlatePrompt
local Storage = game:GetService("ReplicatedStorage")
local PlateInUse = Storage.PlateInUse
Prompt.Triggered:Connect(function(player)
Prompt.Enabled = false
if player.PlayerGui.BuildingGui.Enabled == false then
player.PlayerGui.BuildingGui.Enabled = true
end
if player.PlayerGui.BuildingGui.Enabled == true then
print("GUI enabled.")
end
PlateInUse.Value = script.Parent.CFrame
end)
Any ideas would be very much appreciated.
I’m sure I’m just missing something very obvious but I can’t for the life of me figure out what it is.
No, but the script is replicated across multiple different locations with different proximity prompts. The prompts in the other locations still work, and I’ve tested not disabling the prompt anyway, to no avail.