i shouldve asked this first, are there any errors in output?
run the game and open the output window: view > output
i shouldve asked this first, are there any errors in output?
run the game and open the output window: view > output
is there an npc called Rig in workspace?
the 100 would mean it wait for 100 seconds to check if the Rig exists, if it doesn’t then its just going to take 100 seconds and then error. to check, add
print("Rig Found")
under the
local npc = game.Workspace:WaitForChild("Rig",100)
Yes i do have an Rig
in the workspace
I told him to remove this from his waits since it may very well have been the issue.
In the console there no error say about the script
I copied the code and made a gui with all the requirements and it worked for me, but there is one thing i changed.
i moved the messanger function above the ui.Main.Purchase function, becuase messanger is called there
can u tell me how can i fix this issue?? or give me new code for it??
all i did was move the messanger function
but my frame gui is unvisible is this correct or nah?
and u can pass me the code?
or which line or code u want me to change or move
are u still able to help me with the script issue?
local plr = game.Players.LocalPlayer
local ui = plr.PlayerGui:WaitForChild("TheShop")
local npc = game.Workspace:WaitForChild("Rig")
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
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
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)
npc.Head.ProximityPrompt.Triggered:Connect(function()
ui.Main.Visible = true
end)
ui.Main.Close.MouseButton1Down:Connect(function()
ui.Main.Visible = false
end)
remote.OnClientEvent:Connect(function(mode,text)
messanger(mode,text)
end)
If it says Infinite yield possible anywhere in the output you’re either missing the shop gui or rig somehow
Still doesnt work
my frame gui of Main is unvisible
do u want me to enabled it visible or no
and yes screengui is enable
i also have the rig and the shopgui so idk what is the issue it wont let me open the gui
Can you please start sending the output when you respond.
what does your startergui look like and whats inside the shop gui
include everything, even startergui in the screenshot
also send a picture of your workspace where the rig is
no, picture of the workspace in the explorer