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

How do I make "dirt" that generates randomly ?

Asked by 7 years ago

Doing this because I have a group/game that has something to do with Janitors so, how do I make it so that they click on the "dirt" block and it goes away but after like 5 mins it would generate again.

0
^ Message me on ROBLOX, I might be able to come up with a better system TheHospitalDev 1134 — 7y
0
Edited my answer TheHospitalDev 1134 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

You would need to use a ClickDetector and the actual part.

--An example includes

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)
    script.Parent.ClickDetector.MaxActivationDistance = 0 --'Disables' clicking
    script.Parent.Transparency = 1 --Transparent
    wait(300) --Wait 5 minutes
    script.Parent.Transparency = 0 --Opaque
    script.Parent.ClickDetector.MaxActivationDistance = 32 --Default distance
end)

Edit

local group = 2718024
local rank = 3

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)
    if playerWhoClicked:GetRankInGroup(group) >= rank then --Checks whether the player meets these conditions
        script.Parent.ClickDetector.MaxActivationDistance = 0 --'Disables' clicking
        script.Parent.Transparency = 1 --Transparent
        wait(300) --Wait 5 minutes
        script.Parent.Transparency = 0 --Opaque
        script.Parent.ClickDetector.MaxActivationDistance = 32 --Default distance
    end
end)
0
Did not work rip jitterclicks -5 — 7y
0
Huh, worked for me. You made sure the Script & ClickDetector are in the same part? TheHospitalDev 1134 — 7y
0
Works thank you! Do you know how I can make it so only a "Janitor" rank can only click on it ect, the rank is called "Janitor" group ID is "2718024" and the rank value is "3" jitterclicks -5 — 7y
0
Appreciate it! I tested it with my friend (that is not in the group & not the appropriate rank but he can still click it jitterclicks -5 — 7y
0
Never mind! Thank you so much! :) jitterclicks -5 — 7y
Ad

Answer this question