Clones to the hit.Parent, another player touches it, they get but other loses it, why?
01 | local model = script.Parent |
02 | local toucher = model.Detector |
03 | local label = model.Display.SurfaceGui.Status |
04 | local screen = model.Display |
05 | local BillboardGui = Instance.new( "BillboardGui" ) |
06 | local Text = Instance.new( "TextBox" ) |
10 | toucher.Touched:Connect( function (hit) |
11 | if game.Players:GetPlayerFromCharacter(hit.Parent) and not inuse and not hit.Parent.Head:FindFirstChildOfClass( "BillboardGui" ) then |
13 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
15 | label.Text = 'AUTHORIZING' |
16 | label.TextColor 3 = Color 3. fromRGB( 255 , 239 , 201 ) |
17 | screen.Warning.PlaybackSpeed = 2.3 |
18 | script.Parent.Display.Color = Color 3. fromRGB( 255 , 239 , 201 ) |
19 | model.Glow.Color = Color 3. fromRGB( 255 , 239 , 201 ) |
20 | model.Glow.PointLight.Color = Color 3. fromRGB( 255 , 239 , 201 ) |
25 | label.TextColor 3 = Color 3. fromRGB( 255 , 239 , 201 ) |
26 | script.Parent.Display.Color = Color 3. fromRGB( 255 , 239 , 201 ) |
27 | model.Glow.Color = Color 3. fromRGB( 255 , 239 , 201 ) |
28 | model.Glow.PointLight.Color = Color 3. fromRGB( 255 , 239 , 201 ) |
29 | label.Text = 'AUTHORIZING' |
30 | screen.Warning.PlaybackSpeed = 2.3 |
39 | screen.Warning.PlaybackSpeed = 4 |
40 | label.TextColor 3 = Color 3. fromRGB( 107 , 255 , 66 ) |
41 | script.Parent.Display.Color = Color 3. fromRGB( 0 , 255 , 0 ) |
42 | model.Glow.Color = Color 3. fromRGB( 0 , 255 , 0 ) |
43 | model.Glow.PointLight.Color = Color 3. fromRGB( 0 , 255 , 0 ) |
45 | label.Text = 'NANOCHIP INJECTED' |
46 | BillboardGui.Name = "AuthorizeTag" |
47 | BillboardGui.Parent = hit.Parent:WaitForChild( "Head" ) |
48 | BillboardGui.Active = true |
49 | BillboardGui.Adornee = hit.Parent:WaitForChild( "Head" ) |
50 | BillboardGui.Size = UDim 2. new( 40 , 40 , 1 , 1 ) |
51 | BillboardGui.StudsOffset = Vector 3. new( 0 , 3 , 0 ) |
54 | Text.Parent = BillboardGui |
55 | Text.BackgroundColor 3 = Color 3. new( 0 , 0 , 0 ) |
56 | Text.BackgroundTransparency = 1 |
57 | Text.BorderColor 3 = Color 3. new( 0 , 0 , 0 ) |
58 | Text.Size = UDim 2. new( 1 , 1 , 0.699999988 , 0 ) |
59 | Text.ClearTextOnFocus = false |
60 | Text.Font = Enum.Font.SourceSans |
62 | Text.Text = "AUTHORIZED | " .. hit.Parent.Name |
63 | Text.TextColor 3 = Color 3. new( 0.517647 , 1 , 0 ) |
64 | Text.TextScaled = true |
66 | Text.TextStrokeColor 3 = Color 3. new( 1 , 1 , 1 ) |
67 | Text.TextWrapped = true |
68 | Text.TextYAlignment = Enum.TextYAlignment.Top |
This is used to mark players, but whenever they touch it, a billboard gui gets created which is intended. But if I do it to someone else, the player who touched it before loses the tag, and the new player gets it.
What's the problem?