Hello, i just made a shop with gui, got help from youtube. Everything is fine and works in studio, but if i publish the game, then it wont work in game and servers. Only works in studio, does anyone know what could be wrong and what should i do to get it work in servers too? And yes, filteringenabled is enabled.
The gui opens up but the buy button is not working in the server and im not receiving the tools aswell from shop.
Well, just not to make anything confusing, i will just link the shop tutorial video here, i did exactly everything as in video. Also in the description you can find the shop gui to test it out or to see whats wrong.
https://www.youtube.com/watch?v=c8bWOSU7WKw&t=1s
Shop BUY button script, in replicatedstorage i have a folder named tools and inside tools theres the items i sell on store (sword etc..)
local price = script.Parent.Parent.Price
local tools = game.ReplicatedStorage:WaitForChild("Tools")
local tool = tools:FindFirstChild(script.Parent.Parent.ItemName.Value)
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function()
if player.leaderstats:FindFirstChild("Points").Value >= price.Value then -- currency.
player.leaderstats:FindFirstChild("Points").Value = player.leaderstats:FindFirstChild("Points").Value - price.Value
local clone = tool:Clone()
clone.Parent = player.Backpack
----------------------------------keep the items after they die
local clone2 = tool:Clone()
clone2.Parent = player.StarterGear
end
end)

4 comments
have you tried double checking?
Yeah, i even tried his own gui thats in the description, still it works only in studio. @Kul3dud3123
Have you checked the dev console with F5?
are you sure its a LocalScript? also im having problems with it too lol.