Hello, I’ve made this script to manage the owner of a sign and what they can do to it although the edit prompt featured in this script is visible to everyone even though the owner has already claimed the sign. Any help is appreciated.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local EditEvent = ReplicatedStorage.Events:FindFirstChild("EditEvent")
local Sign = script.Parent.Parent
local ClaimPrompt = Sign.Structure.Prompt:FindFirstChild("Claim")
local EditPrompt = Sign.Structure.Prompt:FindFirstChild("Edit")
local OwnerText = Sign.Structure.Signs.OwnerSign.SurfaceGui:FindFirstChild("Owner")
local OwnerValue = Sign.Values:FindFirstChild("Owner")
ClaimPrompt.Triggered:Connect(function(Player)
if Player.Character:FindFirstChild("Humanoid") and OwnerValue.Value == nil then
ClaimPrompt.Enabled = false
OwnerValue.Value = Player
OwnerText.Text = tostring(OwnerValue.Value.Name).."'s Sign!"
EditPrompt.Enabled = true
end
end)
EditPrompt.Triggered:Connect(function(Player)
if Player.Character:FindFirstChild("Humanoid") and OwnerValue.Value == Player then
EditPrompt.Enabled = false
EditEvent:FireClient(Player)
end
end)