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

why does this script not work?

Asked by
IcyEvil 260 Moderation Voter
9 years ago

Its like a murder mystery script but with screen guis and Inserted bricks, I want the part inside of the persons head But I forgot how to use CFrame in studio, And nothing works for it, No errors just Nothing...

Here is the script.

Names = {"Sarah","Paul","Michael","Heather","Kevin","India"}
Colors = {"Really red","Really blue","Really black","Earth green","Cyan","Pink"}

for i,v in pairs(game.Players:GetChildren()) do
    b = Instance.new("Part", v.Character.Head)
    g = Instance.new("SurfaceGui", v.Character.Head.b)
    t = Instance.new("TextLabel", v.Character.Head.b.g)
b.Size = Vector3.new(3.8, 2.6, 0.8)
b.Position = Vector3.new(44.4, 7.54, -43.25)
b.CanCollide = false
b.Transparency = 1
t.BackgroundTransparency = 1
t.Size = Vector3.new{"0,800"},{"0,600"}
t.Font = "Legacy"
t.FontSize = "Size48"
t.Color = Colors[math.random(#Colors)]
t.Text = Names[math.random(#Names)]
if v.Character.Humanoid.Health == 0 then
v.Character.Head.b.g.t.Text = Names[math.random(#Names)]
end
end
0
You should put b, g, and t variables outside of the for loop, and I recommend using a BillboardGui if you are trying to make the Names hover over the players heads. Vividex 162 — 9y
0
@Vividex He should not as he does that for every character. gskw 1046 — 9y

Answer this question