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
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)