HopperBin tool texture Id URL error?
I don't know why this is happening.. But when I try to use the item they break because the texture ID url is an error. How the tools are made is from a script creating them out another hopperbin tool that's placed in lightning Here is the script for the tool
01 | local bin = script.Parent |
03 | function round(num, idp) |
04 | local mult = 10 ^(idp or 0 ) |
05 | return math.floor(num * mult + 0.5 ) / mult |
10 | function onButton 1 Down(mouse) |
11 | local player = game.Players.LocalPlayer |
12 | if player = = nil then return end |
14 | points = player.leaderstats [ "Stat Points" ] |
16 | upg = player.stats [ type ] |
17 | cost = math.floor(upg.Value ^ 1.45 / 10 ) + 1 |
18 | if (points.Value < cost) then return end |
19 | if (upg.Value > = 4999 ) then return end |
20 | upg.Value = upg.Value + 1 |
21 | player.leaderstats [ "Level" ] .Value = player.leaderstats [ "Level" ] .Value + 1 |
22 | points.Value = points.Value - cost |
23 | bin.Name = type .. ": " .. upg.Value |
26 | function onSelected(mouse) |
28 | mouse.Button 1 Down:connect( function () onButton 1 Down(mouse) end ) |
31 | bin.Selected:connect(onSelected) |
Here is the script that makes them and puts them inside players.
01 | upgs = { "Health" , "Agi" , "Dmg" , "Aspd" , "Pspd" , "Repulsor" } |
03 | function onPlayerRespawn(property, player) |
04 | if property = = "Character" and player.Character ~ = nil then |
05 | for _, upg in ipairs (upgs) do |
06 | local tool = game.Lighting.Default:clone() |
07 | tool.Name = upg .. ": " .. player.stats [ upg ] .Value |
09 | tool.Parent = player.Backpack |
11 | player.Character.Torso.Elasticity = 0 |
15 | function onPlayerEntered(player) |
18 | if player.Character ~ = nil then break end |
22 | local stats = Instance.new( "IntValue" ) |
25 | for _, upg in ipairs (upgs) do |
26 | local attrib = Instance.new( "IntValue" ) |
35 | onPlayerRespawn( "Character" , player) |
36 | player.Changed:connect( function (property) onPlayerRespawn(property, player) end ) |
38 | player.Chatted:connect( function (msg, recipient) onPlayerChatted(player, msg) end ) |
41 | game.Players.ChildAdded:connect(onPlayerEntered) |