Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

2 comments

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?

0

A different function makes it visible and works.

1 answer

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

6 comments

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)

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

0

edited.

0

Instead of -1 like a sneaky peaky like, what about coming forward and telling me whats wrong.

0

That's not the problem, otherwise i wouldnt be able to see the textlabel AT ALL, which I can.

0

Mister, when you delete the stuff inside startergui, but the stuff is already inside playergui. Of course it isn't removed.

This discussion is preserved as it was. New answers, comments, and votes are closed.