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

I'm doing a 911 System and a error pops up... What the error?

Asked by
RootEntry 111
7 years ago

Hi. I am doing a 911 System. Look at this script:

button = script.Parent.Callbutton
locationbox = script.Parent.LocationBox
typeofemergencybox = script.Parent.EmergencyTypeBox
describesittuationbox = script.Parent.DescribeSituationBox
line1 = script.Parent.Parent.OperatorFrame.line1
line2 = script.Parent.Parent.OperatorFrame.line2
line3 = script.Parent.Parent.OperatorFrame.line3
line4 = script.Parent.Parent.OperatorFrame.line4
line5 = script.Parent.Parent.OperatorFrame.line5
line6 = script.Parent.Parent.OperatorFrame.line6
line7 = script.Parent.Parent.OperatorFrame.line7

location = nil
typeofemergency = nil
describesittuation = nil

button.MouseButton1Click:connect(function()
    location = locationbox
    typeofemergency = typeofemergencybox
    describesittuation = describesittuationbox

    line1.Text = line2.Text
    line2.Text = line3.Text
    line3.Text = line4.Text
    line4.Text = line5.Text
    line5.Text = line6.Text
    line6.Text = line7.Text
    line7.Text = "%name%, ".."called for 911, Type Of Emergency: "..typeofemergency..", location: "..location..", Sittuation: "..describesittuation.."!"
end)

It is using a Script not local script because I want it to happen serverside and not local. So then this error pops up:

16:53:07.877 - Players.iiLevelMaker.PlayerGui.ScreenGui.Main.Script:28: attempt to concatenate global 'describesittuation' (a userdata value)

1
Why serverside? hiimgoodpack 2009 — 7y
0
I recommend reading https://scriptinghelpers.org/guides/server-client-relationship-in-roblox . In FilteringEnabled places, at least, server code cannot access gui - use RemoteEvents instead. chess123mate 5873 — 7y
0
I want it serverside so all the people can see the call in the gui. RootEntry 111 — 7y

1 answer

Log in to vote
2
Answered by
awfulszn 394 Moderation Voter
7 years ago
Edited 7 years ago

You're trying to get the text from the variable typeofemergencybox. When all that variable does is specify the location of EmergencyTypeBox, just add .Text onto the end of your typeofemergencybox variable (at the top) and it should work. Do the same for DescribeSituation

Also, use :Connect instead of :connect as that is deprecated.

0
Oh. RootEntry 111 — 7y
1
If this works for you, don't forget to accept my answer. awfulszn 394 — 7y
0
Thanks. RootEntry 111 — 7y
0
You're welcome. awfulszn 394 — 7y
Ad

Answer this question