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

How do i get the server ip on a string?

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

1 comment

2

Why do you need the server ip?

1 answer

✓ Accepted answer

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".

1 comment

0

ok thanks

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