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)

1 comment

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...