I’m making a spamton shop,where you can get quests,from which you’ll get delicious [KROMER].
The issue is in the line 45,here is it:
if plr.SoulFragments:FindFirstChild(current.Value.Materials.Main.Value.Name) then.
I also tried removing the “Name” thing,and it said,that,Argument 1 missing or nil.
Anyways,here is the script:
local current = script.Parent.Current
local plr = game.Players.LocalPlayer
local Quest = game.Lighting.SpamtonQuest:GetChildren()
script.Parent.TextOutline.Text.Text = current.Value.Text.Value
local db = false
for i,v in pairs(Quest) do
local thing = script.Parent.Template:Clone()
thing.Text = v.Text.Value
thing.Visible = true
thing.Parent = script.Parent.DealList
thing.MouseButton1Click:Connect(function()
if db == false then
db = true
script.Parent.Changer:FireServer(v)
wait(0.1)
local text = v.Text.Value
for i = 1,#text,1 do
script.Parent.TextOutline.Text.Text = string.sub(text,1,i)
wait(0.05)
end
wait(0.1)
db = false
end
end)
end
script.Parent.Leave.MouseButton1Click:Connect(function()
if db == false then
db = true
local text = "YOU'RE LEAVING!? WHAT ABOUT MY DISK!?!?"
for i = 1,#text,1 do
script.Parent.TextOutline.Text.Text = string.sub(text,1,i)
wait(0.05)
end
script.Parent.Changer:FireServer(Quest[math.random(1, #Quest)])
wait(1)
script.Parent.Enabled = false
script.Parent.TextOutline.Text.Text = current.Value.Text.Value
wait(1)
db = false
end
end)
script.Parent.Buy.MouseButton1Click:Connect(function()
if current.Value ~= nil and db == false then
db = true
if plr.SoulFragments:FindFirstChild(current.Value.Materials.Main.Value.Name) then
if plr.SoulFragments:FindFirstChild(current.Value.Materials.Main.Value.Name).Value >= current.Value.Materials.Main.Cost.Value then
local text = "DELICIOUS [KROMER]"
for i = 1,#text,1 do
script.Parent.TextOutline.Text.Text = string.sub(text,1,i)
wait(0.05)
end
game.Lighting.BuyKromer:FireServer(current.Value)
else
local text = "WHAT!? YOU WERE SO CLOSE!!"
for i = 1,#text,1 do
script.Parent.TextOutline.Text.Text = string.sub(text,1,i)
wait(0.05)
end
end
end
db = false
end
end)