So this script for some reason doesn't work inside the actual game, but if I test it in Roblox Studio it works?
local ShopButton = script.Parent
local Shop = script.Parent.Parent.Frame
local Close = script.Parent.Parent.Frame.X
local GunGUI1 = Shop.Gun1
local GunGUI2 = Shop.Gun2
local Gun1 = game.ServerStorage:FindFirstChild("Gun1")
local Gun2 = game.ServerStorage:FindFirstChild("Gun2")
Player = game.Players.LocalPlayer
ShopButton.MouseButton1Down:connect(function()
ShopButton.Visible = false
Shop.Visible = true
Close.MouseButton1Down:connect(function()
ShopButton.Visible = true
Shop.Visible = false
end)
end)
GunGUI1.MouseButton1Down:connect(function()
if Player.Backpack:FindFirstChild("Gun2") and Player.StarterGear:FindFirstChild("Gun2") then
Player.Backpack.Gun2:Destroy()
Player.StarterGear.Gun2:Destroy()
end
local Gun1C = Gun1:Clone()
Gun1C.Parent = Player.Backpack
local Gun1D = Gun1:Clone()
Gun1D.Parent = Player.StarterGear
GunGUI1.Visible = false
GunGUI1.Text = ("Bought")
GunGUI2.Visible = true
GunGUI2.Text = ("Gun2")
end)
GunGUI2.MouseButton1Down:connect(function()
if Player.Backpack:FindFirstChild("Gun1") and Player.StarterGear:FindFirstChild("Gun1") then
Player.Backpack.Gun1:Destroy()
Player.StarterGear.Gun1:Destroy()
end
local Gun2C = Gun2:Clone()
Gun2C.Parent = Player.Backpack
local Gun2D = Gun2:Clone()
Gun2D.Parent = Player.StarterGear
GunGUI2.Visible = false
GunGUI2.Text = ("Bought")
GunGUI1.Visible = true
GunGUI1.Text = ("Gun1")
end)

2 comments
Is it a local script
No it's not.