So I'm making a TextButton, and inside it I added a LocalScript that when the button is clicked, I want it to give a player the item "Latte". It works in Roblox Studio, but not in the actual game! Here it is:
local player = game.Players.LocalPlayer
function onClicked()
game.ServerStorage.Latte:clone().Parent = player.Backpack
end
script.Parent.MouseButton1Down:connect(onClicked)
Does anybody know what's wrong with my script? If so, please help!

1 comment
OMIGOSH THANK YOU! I just realized anything with "Server" in it should probably be avoided by client-sided things :P