Money Door | How do I make it local player and it stays forever?
How do I make this script local player so that others cant go through when someone buys it and that the purchase stays forever?
Here is the script : What do I add or delete
01 | local required_points = 2000 |
04 | script.Parent.Touched:Connect( function (hit) |
05 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
06 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
07 | if player.leaderstats.Coins.Value > = required_points then |
10 | script.Parent.Transparency = 0.5 |
11 | script.Parent.CanCollide = false |
13 | script.Parent.CanCollide = true |
14 | script.Parent.Transparency = 0 |
16 | script.Parent.CanCollide = true |
17 | player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - 2000 |
20 | player.Character.Humanoid.Health = 0 |