Hi. Was testing a Gui vending machine script today. It however, only works in studio. When I try to test it in ROBLOX, the TextButton won't give the tool. Here is the script:
tool = game.ServerStorage.Aquafina
script.Parent.MouseButton1Down:connect(function()
local thetool = game.Players.LocalPlayer.Backpack:FindFirstChild("Aquafina")
if thetool then
print "ToolGiven"
else
local g = tool:Clone()
g.Parent = game.Players.LocalPlayer.Backpack
end
end)
Best Regards, Boomer

1 comment
How would the server know what "LocalPlayer" is?