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

Tools doesn't work when online only playing in solo?

Asked by
lomo0987 250 Moderation Voter
10 years ago

All I know is that when I select the tool for this instead of being able to use it and 'upgrade' your skills, it breaks when you select it. It works fine when i'm editing in studio and play solo, but when I go to play it normally it doesn't Print anything when selected and it just says " Image unable to load : Unexpected URL "

local bin = script.Parent

function round(num, idp)
    local mult = 10^(idp or 0)
    return math.floor(num * mult + 0.5) / mult
end



function onButton1Down(mouse)
    local player = game.Players.LocalPlayer
    if player == nil then return end

    points = player.leaderstats["Stat Points"]
    type = bin.Type.Value
    upg = player.stats[type]
    cost = math.floor(upg.Value ^ 1.45 / 10) + 1
    if(points.Value < cost) then return end
    if(upg.Value >= 4999) then return end
    upg.Value = upg.Value + 1
    player.leaderstats["Level"].Value = player.leaderstats["Level"].Value + 1
    points.Value = points.Value - cost
    bin.Name = type .. ": " .. upg.Value
end

function onSelected(mouse)
    print("select")
    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)

Answer this question