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

How do I make a game shout script, I can activate the shout but text doesn't change?

Asked by
Lualaxy 78
6 years ago
Edited 6 years ago

So the box and all shows but the text does not change. I use a text button to activate the shout and a text box on the gui to create a shout.

local Text = script.Parent.Shout.Shout.Text
local Button = script.Parent.ShoutBox.TextButton
local SText = script.Parent.ShoutBox.TextBox.Text
local Frame = script.Parent.Shout

Button.MouseButton1Click:connect(function()
    script.Parent.Shout.Shout.TextScaled = true
    Frame.Visible = true
    Text = SText
    wait(5)
    Frame.Visible = false
    script.Parent.Shout.Shout.TextScaled = false
end)
0
SText.Text? User#20388 0 — 6y
0
Look at the local things at the start they tell you what Text and SText are Lualaxy 78 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You get the text on the start of your script, you should get it when the function runs

You have the same problem with text, as text is a string var it won't update the object propertie.

Also never use Text as a name :/

Like this

local AText = script.Parent.Shout.Shout
local Button = script.Parent.ShoutBox.TextButton
local SText = script.Parent.ShoutBox.TextBox
local Frame = script.Parent.Shout

Button.MouseButton1Click:connect(function()
    script.Parent.Shout.Shout.TextScaled = true
    Frame.Visible = true
    AText.Text = SText.Text
    wait(5)
    Frame.Visible = false
    script.Parent.Shout.Shout.TextScaled = false
end)

Should work :)

0
Works perfectly thanks! Lualaxy 78 — 6y
0
Np :) User#20388 0 — 6y
Ad

Answer this question