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

Possible to make hiden part ?

Asked by 6 years ago
Edited 6 years ago

Hi ! i have read this script but i want change the CanCollide for a hiden part.

Exemple: if player have more than 30 minutes played on my server, the part become hiden and the player can go on the other side (only for players have 30 minutes, not all), i don't know if it's possible ?

Code:

local parent = script.Parent

parent.Touched:Connect(function(other_part)
    local player = game:GetService("Players"):GetPlayerFromCharacter(other_part.Parent)
    if not player then
        return
    end
    local leaderstats = player.leaderstats
    local minutes = leaderstats.Minutes
    if minutes.Value < 30 then
        return
    end
    parent.CanCollide = false
    wait(1)
    parent.CanCollide = true
end)

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

just add transparency

local parent = script.Parent

parent.Touched:Connect(function(other_part)
    local player = game:GetService("Players"):GetPlayerFromCharacter(other_part.Parent)
    if not player then
        return
    end
    local leaderstats = player.leaderstats
    local minutes = leaderstats.Minutes
    if minutes.Value < 30 then
        return
    end
    parent.CanCollide = false
    parent.Transparency = 1
    wait(1)
    parent.CanCollide = true
    parent.Transparency = 0
end)

parent.Transparency = 1 ------ invisible parent.Transparency = 0 ------ visible

You could also put it in the replicated storage

parent.Parent = game.ReplicatedStorage

By the way, you are also changing the cancollide to true meaning they can't walk through the part one second after you make its collisions false

0
thanks but i want delete the part only for user have more than 30 minutes, if i keep the cancollide, some players can walk in the same time and go in the other side ^^ Thorngard 4 — 6y
1
then do it in local script in starter gui, things there happen locally greatneil80 2647 — 6y
Ad

Answer this question