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

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

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)

3 comments

1

Why serverside?

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.

0

I want it serverside so all the people can see the call in the gui.

1 answer

✓ Accepted answer

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.

4 comments

0

Oh.

1

If this works for you, don't forget to accept my answer.

0

Thanks.

0

You're welcome.

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