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

(if player joins, a part becomes transparent)Can someone help with my playerAdded problem?

Asked by 6 years ago
script.Parent.Touched:Connect(function(hit)
game.Workspace.LavaLetdown.BarrierLLD.Transparency = 1
game.Workspace.LavaLetdown.BarrierLLD.CanCollide = false
end)

game.Players.PlayerAdded:connect(function(player)
local stat = Instance.new("IntValue",  player) -- can just change this to whatever type of value you want
stat.Name = "variable"
stat.Value = 0
end)

I need help with combining this two or something so that: if the player joins, barrierlld becomes transparent and false cancollide

1 answer

Log in to vote
0
Answered by
Audiimo 105
6 years ago

You just take away the Touched Event so whenever the player joins it automatically turns invisible

game.Players.PlayerAdded:Connect(function(player)
    local stat = Instance.new("IntValue",  player) -- can just change this to whatever type of          value you want
    stat.Name = "variable"
    stat.Value = 0

    game.Workspace.LavaLetdown.BarrierLLD.Transparency = 1

    game.Workspace.LavaLetdown.BarrierLLD.CanCollide = false
end)

Or if this is what you want just put the Touched Event inside the PlayerAdded Event which isn't different than the code you have written, so I don't see how you would want this.

game.Players.PlayerAdded:Connect(function(player)
    local stat = Instance.new("IntValue",  player) -- can just change this to whatever type of          value you want
    stat.Name = "variable"
    stat.Value = 0

    script.Parent.Touched:Connect(function(hit)
        game.Workspace.LavaLetdown.BarrierLLD.Transparency = .3

        game.Workspace.LavaLetdown.BarrierLLD.CanCollide = false
    end)
end)

0
did not work. once i rejoined, barrier lld is still cancollide=true, RealRexTerm 21 — 6y
0
Id prefer using the Top script if you haven't. I tested it before I wrote the post and it worked Audiimo 105 — 6y
Ad

Answer this question