Try this in a server script inside the button you're tryna click:
local players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
players.PlayerAdded:Connect(function(p)
local pizza = ReplicatedStorage:WaitForChild("Pizza")
local clonedPizza = pizza:Clone()
local backpack = p.Backpack
script.Parent.MouseButton1Down:Connect(function()
clonedPizza.Parent = backpack
end)
end)
If that won't work I can at least tell you what's wrong with your script:
What's wrong with your script?
local Player = game.Workspace.Part.SurfaceGui.TextLabel.Text
local PlayerGUI = game.Players.LocalPlayer.PlayerGui
script.Parent.MouseButton1Down:connect(function()
game.ReplicatedStorage:WaitForChild("Pizza"):Clone().Parent = player.Backpack
You also didnt put and end) at the end
There, I'm probably wrong on most of these but whatever
2 comments
u gotta click detector?
its a mouse down it seems for UI buttons