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

Clones to the hit.Parent, another player touches it, they get but other loses it, why?

Asked by
notfenv 171
5 years ago
01local model = script.Parent
02local toucher = model.Detector
03local label = model.Display.SurfaceGui.Status
04local screen = model.Display
05local BillboardGui = Instance.new("BillboardGui")
06local Text = Instance.new("TextBox")
07 
08local inuse = false
09 
10toucher.Touched:Connect(function(hit)
11    if game.Players:GetPlayerFromCharacter(hit.Parent) and not inuse and not hit.Parent.Head:FindFirstChildOfClass("BillboardGui") then
12        inuse = true
13        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
14        for i = 0, 0 do
15            label.Text = 'AUTHORIZING'
View all 78 lines...

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?

1 answer

Log in to vote
1
Answered by 5 years ago

Well, what it seems like is that the adorned of the billboard UI is being set to the player. Try making the GUI instead then when it’s ready to be used. Use a remote event to trigger a local script inside the GUI. And make sure to enable the GUI from the local script

Ad

Answer this question