0
votes

So I made this code:

local players = game.Players:getPlayers()
local drink = game.ServerStorage.Drink:Clone()
CreateDialogueEvent:FireAllClients(steven_Image,"Eat while it's hot!")
drink.Parent = game.Players.Backpack

To put in all players backpack Drink but it's not working :/ no error in output so any idea how can I fix it? thanks for any help!

1

1 Answers

2
votes

If you only want to give it to the players currently in the server, you could just loop through them:

local players = game.Players:getPlayers()
CreateDialogueEvent:FireAllClients(steven_Image,"Eat while it's hot!")
for _, player in pairs(players) do
    local drink = game.ServerStorage.Drink:Clone()
    drink.Parent = player.Backpack
end

If you want to give it to all of the players right when they join the game, put it in the StarterPack and presto it will be in everyone's backpack.