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

How do you make an "Interact Tool"?

Asked by 9 years ago

Something like the one from Apocalypse Rising. When you select it, then it's in your inventory. Someone guide me through it?

1 answer

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

Well what's in apacalypse rising, I'm assuming, is just those objects that you can 'pick up' just have clickdetectors in them, and that the tool just inserts a value somewhere when selected;

script.Parent.Equipped:connect(function()
    a = Instance.new("StringValue",script.Parent)
    a.Name = "EQ"
    script.Parent.Unequipped:connect(function()
    script.Parent:FindFirstChild("EQ"):Destroy()
    end)
end)

And that those objects that you can pick up have a script inside the that's something like this;

scirpt.Parent.ClickDetector.MouseClick:connect(function(plr)
    if plr.Backpack["Interact Tool"]:FindFirstChild("EQ",true) then
        script.Parent.Parent = [Wherever the item gets stored]
    end
end)

These are all guestimations but that's how I would go about doing it.

-Goulstem

Ad

Answer this question