Teleporting a word from one place to another

You don’t have much to do here. MouseButton1Click runs on the server already. You might want to see if anything it’s waiting for runs on the client or server.

Well yeah that, but i also noticed that if i set and send that data in a server script, it should work.

You can use TeleportData on the server. You can use DataStoreService on the server. I recommend having a remote event.

If you want to do what I have said, let me help you.

Firstly, create a RemoteEvent so you can connect to server.
Fire the RemoteEvent when the player clicks to the button.

Receive the RemoteEvent from Server.
If you know about DataStoreService it would be easy for you.
Save the information that you want to transfer to another place.
For example I’ll send the string "Hello". Also make the SaveKey unique to the player.

If you don’t know how to save, here’s an example.

DataStoreService:SetAsync(Player.UserId .. "-teleportData","Hello")

I also suggest you to do the teleporting proccess from server script to prevent transfer data loss.


Now, add a server script to the place you are teleporting to.
And then, detect when the player joins and load the data you’ve saved before teleporting.

Here’s a loading example;

local transferredData = DataStoreService:GetAsync(Player.UserId .. "-teleportData")

Make sure that the loading key is the same as the key you’ve used when saving.

That’s it printing transferredData will write Hello to output.

If this helped you, can you mark it as solution?

This will cause an error:

Double check before sending!

I would first use TeleportData with the server before moving on to DataStoreService, because that was not tested yet.

What will cause the error?

I told that i didn’t know about TeleportData or how to use that.

This is my own way of doing something

1 Like