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

The Int.Value is higher than others but this does not teleport the player onto other place ?

Asked by 8 years ago

--This is in a Localscript in the ScreenGui

screenGui = script.Parent

Background = screenGui.Background

Map1 = Background.map1
Map2 = Background.map2
Map3 = Background.map3

Vote1 = Background.Vote1
Vote2 = Background.Vote2
Vote3 = Background.Vote3

Votenum1 = Vote1.TextLabel
Votenum2 = Vote2.TextLabel
Votenum3 = Vote3.TextLabel

Int1 = Background.Int1
Int2 = Background.Int2
Int3 = Background.Int3
Voted = false
Map1.MouseButton1Click:connect(function(player)
    if  Voted == false then
    Votenum1.Text = Int1.Value + 1
    Int1.Value = Votenum1.Text
    end
    Voted = true
end)

Map2.MouseButton1Click:connect(function (player)
    if Voted == false then
        Votenum2.Text = Int2.Value + 1
    Int2.Value = Votenum2.Text
    end
    Voted = true
end)

Map3.MouseButton1Click:connect(function (player)
    if Voted == false then
        Votenum3.Text = Int3.Value + 1
    Int3.Value = Votenum3.Text
    end
    Voted = true
end)

wait(5)

local level1Id = 277142443
local TeleportService = game:GetService("TeleportService")

if Int1.Value > Int2.Value and Int3.Value then
    TeleportService:Teleport(level1Id, game.Players.Player1)

end

1 answer

Log in to vote
0
Answered by 8 years ago

If you are testing this in studio it wont teleport you. Also i see that on line 51 you are using game.Players.Player1 This should be game.Players.LocalPlayer

So in other words replace your line 51 with

TeleportService:Teleport(level1Id, game.Players.LocalPlayer)
Ad

Answer this question