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

Making a round-based game but it went sloppy and weird after I tested it?[Self-solved]

Asked by 6 years ago
Edited 6 years ago

[CLOSED BY ME BECAUSE I FOUND A FIX BY C-FRAMING THE CHARACTERS INSTEAD OF LOADING THEM .. Thanks for trying to help me though.]

I can't explain what happened, but here's the script. I don't know if anyone can fix this "confusingness", but it just teleported me everywhere and just did weird stuff with teleporting and loading characters at random times. I can only explain what happened in a video.

plr = script.Parent.Parent.Parent.Parent.Parent
while true do
    local pickRandom = math.random(1, 2)
    script.Parent.Text = "Choosing Map and Waiting for Players."
    wait(20)
    if pickRandom == 1 then
        script.Parent.Text = "Map Chosen: Obby"
        for i,v in pairs(game.Players:GetPlayers()) do
            v.TeamColor = BrickColor.new("Black")
            v:LoadCharacter()
        end
    elseif pickRandom == 2 then
        script.Parent.Text = "Map Chosen: well this is a test soooo.."
        for i,v in pairs(game.Players:GetPlayers()) do
            v.TeamColor = BrickColor.new("Really red")
            v:LoadCharacter()
        end
    end
    wait(100)
    for i,v in pairs(game.Players:GetPlayers()) do
        v.TeamColor = BrickColor.new("White")
    end
end
0
I'm assuming that this is a local script since you have it in a player. I'd recommend switching it over to the server if it isn't. Crazycat4360 115 — 6y
0
Why is player 10 script.Parent ‘s? User#19524 175 — 6y
0
Well, it turns out to be pretty useless. Since the StarterGUI is cloning itself to players, I made it script.Parent's. But you don't need to worry about that, because I never used it anyways. mudathir2007 157 — 6y

Answer this question