You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
To fix my issue of script with gui -
What is the issue? Include screenshots / videos if possible!
My issue is that when i copy and paste my game script
into another game studio file
it wont let me press E to open GUI
Its like doesnt work
In the console it doesnt say anything about this error -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Trying to remake a new script of open/close
Nothing work
local plr = game.Players.LocalPlayer
local ui = plr.PlayerGui:WaitForChild("TheShop",100)
local npc = game.Workspace:WaitForChild("Rig",100)
local items = ui.Main.ScrollingFrame
local template = ui.Template.TextButton
local remote = game.ReplicatedStorage.ShopEvent
local maingroup = 10747388
local selected = nil
function create_list()
for i,v in pairs(game.ReplicatedStorage.Shop:GetChildren()) do
if not items:FindFirstChild(v.Name) then
local newbutton = template:Clone()
newbutton.Name = v.Name
newbutton.Text = v.Name
newbutton.Parent = items
newbutton.Visible = true
end
end
end
function get_price(item)
if game.ReplicatedStorage.Shop:FindFirstChild(item) then
local found = game.ReplicatedStorage.Shop:FindFirstChild(item)
return found.Price.Value
else
items:FindFirstChild(item).Text = "No Pricing found for "..item
task.wait(2)
items:FindFirstChild(item).Text = item
end
end
task.wait(0.2)
create_list()
for i,v in pairs(items:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Down:Connect(function()
selected = v.Name
spawn(function()
v.TextColor3 = Color3.fromRGB(85, 255, 0)
task.wait(1)
v.TextColor3 = Color3.fromRGB(255, 255, 255)
end)
if plr:IsInGroup(maingroup) then
ui.Main.Price.Text = '<b>'.."Price: "..'</b>'..get_price(v.Name) - 200
ui.Main.Discount.Text = '<b>'.."Discount (Membership): "..'</b>'..'<font color="rgb(138, 255, 109)">'.."Yes"..'</font>'
else
ui.Main.Price.Text = '<b>'.."Price: "..'</b>'..get_price(v.Name)
ui.Main.Discount.Text = '<b>'.."Discount (Membership): "..'</b>'..'<font color="rgb(255,71,71)">'.."No"..'</font>'
end
ui.Main.Selection.Text = '<b>'.."Selected: "..'</b>'..v.Name
end)
end
end
ui.Main.Purchase.MouseButton1Down:Connect(function()
if selected ~= nil then
remote:FireServer(selected)
task.wait(0.2)
ui.Main.Selection.Text = '<b>'.."Selected: "..'</b>'
ui.Main.Price.Text = '<b>'.."Price: "..'</b>'
ui.Main.Discount.Text = '<b>'.."Discount (Membership): "..'</b>'
selected = nil
else
messanger("Error", "Select the item from the list once again! And press Purchase!")
end
end)
function messanger(mode,text)
if mode == "Error" then
ui.Main.Visible = false
ui.NotifBox.Visible = true
ui.NotifBox.TextLabel.Text = '<font color="rgb(255,71,71)">'.."ERROR: "..'</font>'..text
task.wait(4)
ui.NotifBox.TextLabel.Text = ""
ui.NotifBox.Visible = false
ui.Main.Visible = true
end
end
npc.Head.ProximityPrompt.Triggered:Connect(function()
if not ui.Main.Visible then
ui.Main.Visible = true
end
end)
ui.Main.Close.MouseButton1Down:Connect(function()
if ui.Main.Visible then
ui.Main.Visible = false
end
end)
remote.OnClientEvent:Connect(function(mode,text)
messanger(mode,text)
end)