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

What is a script for that makes you touch something and it dissapears?

Asked by 9 years ago

And once the player who touches it leaves, it regens? Example: You eat something. I touch it, and it goes away. When I leave about 5-10 inches (or feet, if I'm wrong), it comes back. Anyone know?

2 answers

Log in to vote
0
Answered by 9 years ago

You can figure out the 5-10 inches thing yourself, but roblox isn't measured in inches, it's studs. Also, here's how to make it regen:

Put a copy of it in lighting, and make this script inside it, and the copy:

local timebr =10 -- time before it regens

script.Parent.Touched:connect(function(hit)
    if hit.Parent:findFirstChild("Humanoid") then
        for i,v in pairs(script.Parent:GetChildren()) do
            if v:IsA("Part") or v:IsA("WedgePart") or v:IsA("CornerWedgePart") then
                coroutine:wrap(function()
                    for i = 1,10 do
                        v.Transparency = v.Transparency+.1
                        wait(.1)
                    end
                end)()
            end
        end
        v:Destroy()
        wait(timebr)
        game.Lighting.Model:Clone().Parent = workspace -- change model to the name of the clone
    end
end)

What this would do, if you changed model to the name of the model in lighting, where the second comment is, would be:

When it's touched, check if it's a player, and if so, make a cool animation (dissapearing moderately fast) then destroy it, wait how many seconds you changed timebr to, then regenerate it.

I know this isn't exactly what you wanted, but please accept this answer, because I wrote this code off the top of my head, without any help, and we both get 1 credit, so win-win?

Ad
Log in to vote
0
Answered by 9 years ago

This isn't a request site you are not suppose to ask script here, this is meant to be for scripters (Who actually knows how to script) to share and take a look at script problems. not for people who just wants to get a specific script.....

Answer this question