You can write your topic however you want, but you need to answer these questions:
Basically I made a Booth where a Player can claim it and from there they’d have the ability to change the text of the header that’s located on the booth plain and simple.
-
I’m creating all the UI’s via Script I just think it’s much better can be edited easily & keeps everything organized.
-
Via Server if a Player claims a Booth and the UI pops up would that mean it’d pop up for everyone in the server?
-
How do I give the Player the ability to change the text on the Booth part from the UI.
-
If a Player has the ability to change text on the part via UI, does that mean I’d have to somehow put security checks on the words that they are typing or does Roblox do that manually?
Main issue is I just can’t figure it out and my brain is any help would really appreciated! I’ll post the code below for a better idea of what I did (btw this is my 2nd week of programming using lua i probs know my code bad dont roast
)
-- local Players = game:GetService("Players")
local ProximityPromptService = game:GetService("ProximityPromptService")
local TweenService = game:GetService("TweenService")
local ProximityPrompt = Instance.new("ProximityPrompt")
ProximityPrompt.Parent = game.Workspace.Booth.ProxPart
ProximityPrompt.Enabled = true
ProximityPrompt.HoldDuration = 0.3
ProximityPrompt.ActionText = "Claim Booth"
local SurfaceGui = Instance.new("SurfaceGui")
SurfaceGui.Parent = game.Workspace.Booth.Header
SurfaceGui.Face = "Back"
local FrameGui = Instance.new("Frame")
FrameGui.Parent = SurfaceGui
FrameGui.Size = UDim2.new(1, 0, 1, 0)
FrameGui.BackgroundColor3 = Color3.fromRGB(39, 39, 39)
local TextGui = Instance.new("TextLabel")
TextGui.Parent = FrameGui
TextGui.Size = UDim2.new(1, 0, 1, 0)
TextGui.Font = Enum.Font.FredokaOne
TextGui.BackgroundTransparency = ""
TextGui.TextColor3 = Color3.fromRGB(84, 138, 255)
TextGui.Text = "Empty"
TextGui.TextScaled = true
local BillboardGui = Instance.new("BillboardGui")
BillboardGui.Parent = game.Workspace.Booth.Header
BillboardGui.Size = UDim2.new(1, 0, 1, 0)
BillboardGui.StudsOffset = Vector3.new(-1.5, 5, 0)
local TextGui2 = Instance.new("TextLabel")
TextGui2.Parent = BillboardGui
TextGui2.Size = UDim2.new(4, 0, 1, 0)
TextGui2.Font = Enum.Font.FredokaOne
TextGui2.TextStrokeTransparency = 0.9
TextGui2.TextColor3 = Color3.fromRGB(255, 255, 255)
TextGui2.Text = "Claim Booth!"
TextGui2.TextScaled = true
TextGui2.BackgroundTransparency = 1
local ScreenGui2 = Instance.new("ScreenGui")
ScreenGui2.Parent = game.StarterGui
ScreenGui2.Enabled = false
local Frame = Instance.new("Frame")
Frame.Parent = ScreenGui2
Frame.Active = true
Frame.Size = UDim2.new(0.5, 0, 0.5, 0)
Frame.BackgroundColor3 = Color3.fromRGB(255, 161, 124)
local tweenInfo = TweenInfo.new(
2.5,
Enum.EasingStyle.Elastic,
Enum.EasingDirection.Out,
-1,
true,
3
)
local Tween = TweenService:Create(TextGui2, tweenInfo, { Size = UDim2.new(3.5, 0, 4, 0) })
Tween:Play()
local CheckUser = Players.PlayerRemoving
local Claimed = Instance.new("ObjectValue")
Claimed.Value = nil
ProximityPrompt.Triggered:Connect(function(player)
if Claimed.Value == nil then
Claimed.Value = player
TextGui2.Text = "Owned by: " .. player.Name
TextGui2.TextColor3 = Color3.fromRGB(255, 255, 255)
Tween:Cancel()
-- Displaying User Interface Pop Up if Booth is Claimed by a Player.
if Claimed.Value == player then
end
local function onPlayerRemoving(player)
Claimed.Value = nil
TextGui2.Text = "Claim Booth!"
TextGui2.TextColor3 = Color3.fromRGB(255, 255, 255)
Tween:Play()
print("A player has left: " .. player.Name)
end
Players.PlayerRemoving:Connect(onPlayerRemoving)
end
end)
print("Booth Successful")