Hello,
I am sure many of you have seen the shops on some simulators when they use camera manipulation
and all that other stuff.
so the only problem I had with this is I can’t figure out how to eqiup only one weapon at a time.
this is my buy script.
game.ReplicatedStorage.ShopBuy.OnServerEvent:Connect(function(player,page)
local tool = game.ReplicatedStorage:WaitForChild(“Tools”)
local shop = game.Workspace.Shop
local clone = tool:FindFirstChild(shop:FindFirstChild(“Part”…page).ItemName.Value):Clone()
local clone2 = tool:FindFirstChild(shop:FindFirstChild(“Part”…page).ItemName.Value):Clone()
clone.Parent = player.Backpack
clone2.Parent = player.StarterGear – So that the player wont lose item when they die
end)
And this is when a player taps on the buy circle
game.ReplicatedStorage.TriggerCam.OnClientEvent:Connect(function()
local player = game.Players.LocalPlayer
local shop = player.PlayerGui.Shop
local camera = workspace.CurrentCamera
local mainshop = workspace.Shop
local item = shop.Item
local buy = shop.Frame.Buy
local shadow = buy.Shadow
if shop.Closed.Value == false then
if shop.Open.Value == false then
shop.Open.Value = true
shop.Frame:TweenPosition(UDim2.new(0,0,0,0),"Out","Quint",1,true)
shop.Item.Value = 1
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = mainshop.Cam1
camera.CFrame = mainshop.Cam1.CFrame
shop.Frame.TextLabel.Text = mainshop:FindFirstChild("Part"..shop.Item.Value).ItemName.Value
shop.Frame.Buy.Text = mainshop:FindFirstChild("Part"..shop.Item.Value).ItemPrice.Value
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
if player.Backpack:FindFirstChild(workspace.Shop:FindFirstChild("Part"..item.Value).ItemName.Value) ~= nil then
buy.Text = "Bought"
buy.BackgroundColor3 = Color3.new(0.7,0.7,0.7)
shadow.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
else
buy.Text = workspace.Shop:FindFirstChild("Part"..item.Value).ItemPrice.Value
buy.BackgroundColor3 = Color3.fromRGB(85,255,127)
buy.BackgroundColor3 = Color3.fromRGB(70, 212, 104)
end
end
end
end)
so it is equiping more than 1 item.
help would be heavily appreciated.
Thank you for reading.