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

Is it possible to make a tool not be able to be taken from the Workspace?

Asked by
nap516 87
7 years ago

Is there like a property for that? Answer it for reputation.

3 answers

Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
7 years ago

I'll give you a correct answer!

You can't do that, but there's a similar way.

Get your tool, and put it on the ReplicatedStorage, used specially to store tools. Copy the tool, transform it into a model, and paste it into the Workspace.

Like that, we will have a "clone" of the tool, but that can't be picked.

Let's say you want it to the player make an action and be able to pick it up. There, you should use the following:

--the condition action would happen here. (then)
while wait() do
    game.Workspace.Tool.Handle.Touched:connect(function() --Replace 'Tool' with the Model copy of the tool's name and the handle with the 'main' part of the tool, which is called, the most of the times, Handle.
        --clone the tool on replicated storage to the player, and destroy the tool's model, so it will look like it was picked, which would happen if the model was actually the tool.
        local clone = game.ReplicatedStorage.Tool:Clone() --Replace 'Tool' with the tool's name
        --There the clone has been done, now we will destroy the model!

        game.Workspace.ModelTool:Destroy() --Replace ModelTool with the Model's name that's "replacing" the actual tool

        --Now let's set the clone's parent, so it will appear in the workspace!

        clone.Parent = game.Workspace

        --Ok, let's stop the loop.

        break
    end)

end

--AND WE'RE DONE!!!
0
It works, thanks! But the break isn't needed at the end since it isn't a while true do. nap516 87 — 7y
0
the break is needed, because while wait() do isn't while true do, but both are loops, and every loop needs a 'break' if you want to stop it, even if it's not a while true do. OfcPedroo 396 — 7y
Ad
Log in to vote
0
Answered by
fuj 49
7 years ago

What do you mean? Like it's parent being changed from a script?

0
I mean if you touch the tool it won't put it in your inventory. nap516 87 — 7y
Log in to vote
0
Answered by
I_0KI 40
7 years ago

I think you could just take the model out of the tool and delete the scripts and sounds.

0
I was planning on making it be suspended from the roof of an arena to where if you clicked the hook a few times it would fall down. I don't know if I can work around it with it being a model. nap516 87 — 7y

Answer this question