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

How do i get the server ip on a string?

Asked by 6 years ago

Hi i made a script to get the server ip

local id = require
script.Parent.Text = "Server Ip:" .. id

but that don't work and the output is

11:42:28.866 - workspace.Folder.Name = require:1: bad argument #3 to 'Name' (string expected, got function)
11:42:28.869 - Stack Begin
11:42:28.872 - Script 'workspace.Folder.Name = require', Line 1
11:42:28.874 - Stack End
2
Why do you need the server ip? User#5423 17 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

You shouldn't need the server ip. However, for use in TeleportService, you might want game.JobId.

require simply requires a ModuleScript and returns the table/object returned by that ModuleScript. ex, you could do local Class = require(workspace.Class), assuming workspace.Class is a ModuleScript that returns a table representing "Class".

0
ok thanks palame135 44 — 6y
Ad

Answer this question