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

SOLVED! ANSWER: IM STUPID LOL Why dose this only work in studio, and not in the actual game?

Asked by
Dr_Doge 100
9 years ago

So Im makeing a game called SkyWars and well the BreakTool works whenever you test it in studio... but it dose't when you save and play the actuial game.

This has happened to me alot... not just in this game.

well heres the script inside my BreakTool.

bin = script.Parent
local pack = bin.Parent
local player = pack.Parent

function onButton1Down(mouse)
    local hit = mouse.Target
    if (hit == nil) then return end
        if (hit.Block ~= nil) then -- dont worry about all this. hit.Block  dose exist (Theres a value called Block in hit)

            local block = game.Lighting.PlaceBlock:Clone() -- or about all this
            block.Parent = game.Players.LocalPlayer.Backpack -- or this
            block.Name = ""..hit.Name.."" -- or this. It works.

            hit:remove()
        end
    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)

Thanks for reading!

0
Why are you asking us to vote up? Nickoakz 231 — 9y
0
Cos hes low on upvotes. neoG457 315 — 9y
1
You don't upvote just because someone is low on upvotes. People upvote if the question was fair, or spammy, or upvote for whatever reason they feel. Nickoakz 231 — 9y
0
so more people can see it. Thats what Vote Ups do right? Dr_Doge 100 — 9y
View all comments (2 more)
0
Is they script a local script? Hopperbins require a local script in order to function and while in studio mode all scripts act like local scripts, so it would explain the problem. BlackJPI 2658 — 9y
0
oooo Dr_Doge 100 — 9y

Answer this question