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

Textlabel flopped, could someone help me fix it? [SOLVED]

Asked by
drew1017 330 Moderation Voter
9 years ago

EDIT: Fixed, it was one of ROBLOX's infamous variable glitches.

S1box = Instance.new('TextLabel')
S1box.Parent = S1boxS
S1box.Visible = false
S1box.TextWrapped = true
S1box.TextColor3 = Color3.new(0, 0, 0)
S1box.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
S1box.BorderColor3 = Color3.new(0, 0, 0)
S1box.Size = UDim2.new(0, 320, 0, 60)
S1box.Position = UDim2.new(0, 25, 0, 25)
if game.Players.LocalPlayer.Character.gameChar.Value == 1 then
    S1box.Text = [[Shield (17.5 second cooldown) (0 upgrades)
    20% damage absorbed for 7.5 seconds
    +4 % damage absorbed and +0.25 second duration per upgrade
    Press '1' to use
    Click to upgrade if skill points available]]
end

The textLabel says just 'Label', even though my gameChar.Value is 1. No errors cropped up, so could someone fill me in on what I did wrong?

0
You're making Visible false which would make the GUI invisible so you'll be unable to see the newly made textlabel, why are you doing that? alphawolvess 1784 — 9y
0
A different function makes it visible and works. drew1017 330 — 9y

1 answer

Log in to vote
-1
Answered by
iNicklas 215 Moderation Voter
9 years ago
S1box = Instance.new("TextLabel", game.Players.LocalPlayer.PlayerGui.S1boxS)

S1box.Visible = false
S1box.TextWrapped = true
S1box.TextColor3 = Color3.new(0, 0, 0)
S1box.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
S1box.BorderColor3 = Color3.new(0, 0, 0)
S1box.Size = UDim2.new(0, 320, 0, 60)
S1box.Position = UDim2.new(0, 25, 0, 25)
if game.Players.LocalPlayer.Character.gameChar.Value == 1 then
    S1box.Text = [[Shield (17.5 second cooldown) (0 upgrades)
    20% damage absorbed for 7.5 seconds
    +4 % damage absorbed and +0.25 second duration per upgrade
    Press '1' to use
    Click to upgrade if skill points available]]
end

0
You need the location different. Placing it in StarterGui will not be visible then unless the player dies. So we need it in PlayerGui, so Instance.new("TextLabel", game.Players.LocalPlayer.PlayerGui) alphawolvess 1784 — 9y
0
Btw, you should make S1box a variable of the Instance.new instead of how line 3 is. And we don't know where he exactly wants the GUI so he needs to tell us his hierarchy of the GUI alphawolvess 1784 — 9y
0
edited. iNicklas 215 — 9y
0
Instead of -1 like a sneaky peaky like, what about coming forward and telling me whats wrong. iNicklas 215 — 9y
View all comments (2 more)
0
That's not the problem, otherwise i wouldnt be able to see the textlabel AT ALL, which I can. drew1017 330 — 9y
0
Mister, when you delete the stuff inside startergui, but the stuff is already inside playergui. Of course it isn't removed. iNicklas 215 — 9y
Ad

Answer this question