Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Cup giver script for cafe doesn't give staff cups?

Asked by 6 years ago

My cup giver script is supposed to give players a tool called Cup when a button is clicked. The cup is in serverstorage. I see absolutely no reason why the script shouldn't work, but it doesn't. Why?

local ToolName = ("Cup")
local Storage = game:GetService("ServerStorage")
local Part = script.Parent
local clickdetector = Part:WaitForChild("ClickDetector")
clickdetector.MouseClick:connect(function(Player)
    if Player and Player.Character then 
        local backpack = Player:FindFirstChild("Backpack")
        for i = 1, #ToolName do
            local Tool = Storage:FindFirstChild(ToolName[i])
        if Tool then
            Tool:clone().Parent = backpack
        end
        end
        end
end)
0
is your game FE? xEiffel 280 — 6y
0
put it in replicated storage and edit the script for that? FlippinAwesomeCrew 62 — 6y
0
How about putting the Cup in Lighting? GamersLeo 0 — 6y

Answer this question