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

Why does this script work testing it in edit mode but not publish mode?

Asked by 9 years ago

this dig tool works 100% fine when i test in edit mode but then when i publish it, it dosnt work. I don't see whats wrong. please help. thanks

bin = script.Parent
halt = false

function onButton1Down(mouse)
    local hit = mouse.Target

    if (hit == nil) or (halt == true) then return end
    halt = true
    mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
    bin.Ping:play()

    if (hit.Name == "Rock") then
                while hit.Transparency <= 1 do
                hit.Transparency = hit.Transparency + 0.2
                wait(0.7)
                end

            wait(0.7)
            hit.Parent = nil
    end

    if (hit.Name == "Dirt") then
                while hit.Transparency <= 1 do
                hit.Transparency = hit.Transparency + 0.2
                wait(0.10)
                end

            wait(0.10)
            hit.Parent = nil
    end

    if (hit.Name == "LooseRock") then
                while hit.Transparency <= 1 do
                hit.Transparency = hit.Transparency + 0.2
                wait(0.30)
                end

            wait(0.50)
            hit.Parent = nil
    end

    wait(0.10)
    halt = false
    mouse.Icon = "rbxasset://textures\\GunCursor.png"
end


function onSelected(mouse)
    --print("Action Tool Selected")
    mouse.Icon = "rbxasset://textures\\GunCursor.png"
    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)

0
Please Help Me. QuantumScripter 48 — 9y
0
This wont get fixed if no one helps. QuantumScripter 48 — 9y
0
Is this a server script? Only local scripts run inside the Player. Perci1 4988 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

Assure that you're using a LocalScript object as opposed to a server-sided Script. PlaySolo runs all scripts on the client, meaning that you need to make it run client-side in-game.

0
What does make it run client-side in-game mean? QuantumScripter 48 — 9y
0
Omg, thank you. I switched the Script to a LocalScript and it fixed it, thank you sooo much QuantumScripter 48 — 9y
0
No problem. RaverKiller 668 — 9y
Ad

Answer this question