(((Buying Script for my Sword Shop Gui )))) (i use gold , dont know if it matter) You want me to explain it i tried everything there is 8-20 hours wasted to try and get a shop to work, and it wont work I've tried scripting it in so many ways i tried using other peoples script. so it is set up to a text button and when you click on it, it opens up the shop but when you purchase one of the items it takes the gold needed but the item doesn't go into my inventory

i got a ranged shop, staff shop, spell shop,sword shop, armor shop and its all connected as you can see from the script bellow but yet after checking over it a billion times going through all the scripts i cant seem to find a single error so i need help from experienced scripters in helping me to find the solution for my new mmorpg roblox game that i'm making . since everything is connected once i work out how to get my sword shop to work everything else will work.

local items = script.Parent.Frame:GetChildren()

for i = 1, #items do function buy() Cash = script.Parent.Parent.Parent.Parent.leaderstats:FindFirstChild(items[i].Currency.Value) h = Instance.new("Hint") h.Parent = script.Parent.Parent.Parent if Cash.Value >= items[i].Cost.Value then Cash.Value = Cash.Value - items[i].Cost.Value toolca = Game.ReplicatedStorage:FindFirstChild(script.Parent.Folder.Value):FindFirstChild(items[i].ItemName.Value):Clone() toolcb = Game.ReplicatedStorage:FindFirstChild(script.Parent.Folder.Value):FindFirstChild(items[i].ItemName.Value):Clone() toolca.Parent = script.Parent.Parent.Parent.Parent.Backpack toolcb.Parent = script.Parent.Parent.Parent.Parent.StarterGear print("Successfully bought!") h.Text = "You have bought " ..items[i].ItemName.Value.. "!" else print("Insufficient money!") h.Text = "You don't have enough " ..items[i].Currency.Value.. "!" end Game:GetService("Debris"):AddItem(h, 2) end items[i].BuyButton.MouseButton1Click:connect(buy) end

(((Sword Shop Button)))

button = script.Parent

function onTouch(part) if part.Parent:FindFirstChild("Humanoid") ~= nil then local player = Game.Players:GetPlayerFromCharacter(part.Parent) if player ~= nil then local GUI = Game.ReplicatedStorage:FindFirstChild(script.Parent.ShopGUI.Value) local AlreadyHaveGUI = player.PlayerGui:FindFirstChild(script.Parent.ShopGUI.Value) if AlreadyHaveGUI == nil then GUI:Clone().Parent = player.PlayerGui else print("Already have GUI!") end end else print("Humanoid not found!") end end

button.Touched:connect(onTouch)

If someone could please help me asap that would be muchly appreciated

4 comments

0

The last time you posted this exact question, it was removed for a reason.

0

you didnt give me a reason you just posted a link

0

I sent you the link for a reason, and you should review it before re-posting this question. Here: https://scriptinghelpers.org/help/how-post-good-questions-answers

0

Also, I recommend using the code block feature instead of pasting it in plain text.