Player touched part script help

can anyone help me create a script that when a player steps on a part a differant part becomes visible, i have tryed so many ways and youtube tutorials but nothing works.

Can I see the explorer tab so I can see what you did?

How about naming one part “touched” and the other “appearingPart”. It’s probably transparency and collision your talking about.

image

here, basicly what i need to happen is that when you step on the button, if you have enough money to buy the stage it makes the next part of the obby visible and so on

1 Like

ye, but its the “on touch” script that wont work, i dont know what to do

To detect a part being touched by a player simply use a touch event:

local partToBeTouched = game.Workspace.TouchPart

partToBeTouched.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        game.Workspace.PartToAppear.Transparency = 0
    end
end)
1 Like

Next part of the obby means an entire stage right? (a model?)

You can store the unlockable stages in ReplicatedStorage and clone them into the Workspace, when the player touches the button.

1 Like

Can you show the script or solutions you have tried?

For this you probably would have to use the script applied below:

local part = script.Parent.Parent.AppearingPart
 
part.Transparency = 1
part.CanCollide = false

local player
script.Parent.Touched:Connect(function(hit)
    player = hit.Parent:FindFirstChild("Humanoid")
    if player then
        part.Transparency = 0
        part.CanCollide = true
    end
end)

Make sure to rename the appearing part: “AppearingPart” and that both parts are anchored.

local scripts dont run in workspace

1 Like

That sounds like a good idea, @TheAviator2410

Oops, this should have been game.Players

Mobile typo, also you are correct this would be replicated across all clients.

1 Like