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 Supposed to be for a Murder Mystery Type game, Except made from Screen Guis on Invisible parts, It is not working for some reason though, No errors, Just doesnt work, Any reason why?

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

1 answer

Log in to vote
0
Answered by
TopDev 0
9 years ago

You forgot an end! Edit : (Multiple errors)

Try this ;

names = {"Sarah","Paul","Michael","Heather","Kevin","India"}


for i,v in pairs(game.Players:GetChildren()) do
if workspace:FindFirstChild(v.Name) then
c = BrickColor.Random()
local b = Instance.new("BillboardGui",v.Character.Head)
b.Size = UDim2.new(6,0,2,0) 
b.StudsOffset = Vector3.new(0,1.5,0)
local text = Instance.new("TextLabel",b) 
text.Size = UDim2.new(1,0,1,0) 
text.Text = names[math.random(1,#names)] 
text.TextColor3 = c.Color 
text.TextScaled = true text.BackgroundTransparency = 1
end
end



0
still does nothing :c IcyEvil 260 — 9y
0
Found another error. let me try to see what I can do. TopDev 0 — 9y
0
Found multiple errors, fixing. TopDev 0 — 9y
0
Try it now. TopDev 0 — 9y
0
Also, if you was to use invisible parts, you'd have to weld the part to the characters head or somthing, as it just falls to the ground, and if this happend, so would the name as the Billboardgui is in the part. TopDev 0 — 9y
Ad

Answer this question