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

Script doesn't work in Server?

Asked by
woodengop 1134 Moderation Voter
9 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

I made a script, a Toolbar UI, and in Studio it worked fine no Errors, but Won't work on the server:

-- it is in a localscript.
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)

toolbar=script.Parent.tool
toolParent=game.ReplicatedStorage:GetChildren() -- there is one tool(the tool i want)
config=script.Parent.Configuration

--character
hum=game.Players.LocalPlayer.Character:WaitForChild'Humanoid'

tools={}

for index,value in pairs(toolParent) do
    if value:IsA'Tool' then
        config.ObjectName.Value=value.Name
        toolbar.Text=config.ObjectName.Value
        table.insert(tools,value)
    end
end


local function GiveObjects()
    local tool=tools[1]
    hum:EquipTool(tool)
    toolbar.bk:TweenSize(UDim2.new(0.5, 45, 0, 0), "Out", "Quad", .3, false)
end

toolbar.MouseButton1Down:connect(GiveObjects)
0
Would be nice if the title wasn't just another "My code doesn't work" title. We know it doesn't work, that's why you're posting it... Unclear 1776 — 9y

Answer this question