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

The teleport teleportdata does not work for me. Solution?

Asked by 5 years ago

I made a Gui so that you can choose what graphics quality that game should have. You have the choice between low quality or high quality. Once chosen between Yes (Ja) or No (Nein), another Gui comes to confirm the selection. If yes is pressed, then the answer is saved as a bool value and you are teleported in the game. The answer is used to adapt the game (if you have chosen high graphics then the game will also have more details and will be harder to load if you have chosen the opposite then the game will have fewer details, but less powerful device can make it easier play) However, if I try it and teleport it, the bool is always false, even if it was true before. How can I solve it?

Here is the Code:

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Ja = script.Parent.JaKiste
local Nein = script.Parent.NeinKiste
local Time = Instance.new("IntValue",Players.LocalPlayer)
Time.Name = "Time"
Time.Value = 8
local placeId = 3503989334 
local Bool = game.Players.LocalPlayer:WaitForChild("Bool")
local GrafikTitel = script.Parent.Parent.GrafikTitel

local teleportData = {
  Option1 = game.Players.LocalPlayer.HochGrafik_Ok.Value,
  Option2 = game.Players.LocalPlayer.NiedrigGrafik_Ok.Value
}

Ja.MouseButton1Click:Connect(function()
    TeleportService:TeleportToSpawnByName(placeId, ("Teleport Anfang Spawn"),player, teleportData)
end)

Nein.MouseButton1Click:Connect(function()
    if Bool.Value == true then
        local Background2 = script.Parent
        local HochGrafik = script.Parent.Parent.HochGrafik
        local NiedrigGrafik = script.Parent.Parent.NiedrigGrafik
        Background2:TweenPosition(UDim2.new(0.5, 0,1.2, 0),"Out","Bounce", 5, true)
        NiedrigGrafik:TweenPosition(UDim2.new(0.75, 0,0.45, 0),"In","Back", 3, true)
        HochGrafik:TweenPosition(UDim2.new(0.25, 0,0.45, 0),"In","Back", 3, true)
        GrafikTitel:TweenPosition(UDim2.new(0.5, 0,0.1, 0),Enum.EasingDirection.In, Enum.EasingStyle.Bounce, 3, true)
        wait(5)
        for _,v in pairs(game.Players.LocalPlayer:GetChildren()) do
        if v:IsA("BoolValue")then
        v.Value = false
      end
    end
    Bool.Value = false
  end
end)

Thank you for taking the time to explain it to me and for writing the solution ^-^

2 answers

Log in to vote
0
Answered by 5 years ago

I would go about this all differently and make a script that takes that input and makes the graphics worse or better (Not that I know how to make a script that controls the graphics,) think that the high detail and low detail are in the workspace together. The low detail will cause the high detail more lag, because it has to load the low detail too, and the high detail will cause the low detail lag, because it would still have to load the high detail. What I’m saying is, with them both in workspace together, it gets laggier than just having one. I hope this helps! ^w^

Ad
Log in to vote
0
Answered by 5 years ago

Thank you for your answer, but it's not the question. Let's say I'm the player and have a strong computer. I'll then click on "High Graphics". If I click it, then the Bool Value of High Graphics goes to the LocalPlayer true. This allows the other game to know how to load it. To make sure that the high graphic is its Bool Value true, I used the print method before. The output told me (true). So I knew it worked. I then put the two value (which is not only a bool value for high graphics, but also en Bool Value for LowGraphics) into a table. I then used this as teleport data to use it in another game. In the other place I wanted to know if the data it had been to come up to there, so I used the print again to find out. However, the bool had suddenly gone from true to false. I hope I was clear enough with my problem

0
are the author 0 Answered by Eternalove_fan32 65 4 minutes ago Thank you for your answer, but it's not the question. Let's say I'm the player and have a strong computer. I'll then click on "High Graphics". If I click it, then the Bool Value of High Graphics goes to the LocalPlayer true. This allows the other game to know how to load it. To make sure that the high graphic is its Bool Value true, Eternalove_fan32 188 — 5y

Answer this question