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

Script not changing a text all of a sudden without any changes?

Asked by 5 years ago

Hi there all,

I have a script and all of a sudden, with no changes made, one of the parts has stopped working. It used to work fine but for some reason it doesnt work anymore. It doesnt print any errors or info in the output. The script is below.

function Control(player,bn,ln,dc,ld)
    local rank = game.Players[player.Name]:GetRankInGroup(1096916)
    game.Players:FindFirstChild(tostring(player.Name)).PlayerGui.SpawnGUI.Finish.Status.Text = "The server is processing your request, please wait..."
    if rank ~= 0 then
        if rank ~= 2 then
            if ld == true and rank >2 then
                local count = table.getn(queue)
                table.insert(queue,tostring(player))
                table.insert(queue,bn)
                table.insert(queue,ln)
                table.insert(queue,dc)
                Spawn_ServerComms()
            elseif ld == false then
                local count = table.getn(queue)
                table.insert(queue,tostring(player))
                table.insert(queue,bn)
                table.insert(queue,ln)
                table.insert(queue,dc)
                Spawn_ServerComms()
            elseif ld == false and rank <2 then
                game.Players:FindFirstChild(tostring(player)).PlayerGui.SpawnGUI.Finish.Status.Text = "You must be LD+ to drive this bus!"
            end
        else if rank == 2 then
            game.Players:FindFirstChild(tostring(player)).PlayerGui.SpawnGUI.Finish.Status.Text = "You are suspended and cannot drive!"
        end
        end
    else 
        game.Players:FindFirstChild(tostring(player)).PlayerGui.SpawnGUI.Finish.Status.Text = "Error: Server unauthorised your request."    
    end
end

receive = game.ReplicatedStorage:WaitForChild("Spawn_Client")
receive.OnServerInvoke = Control

The part in question is these parts, they don't do anything and the script doesn't break or return anything, it just no longer wants to change the text anymore.

game.Players:FindFirstChild(tostring(player.Name)).PlayerGui.SpawnGUI.Finish.Status.Text = "The server is processing your request, please wait..."
game.Players:FindFirstChild(tostring(player)).PlayerGui.SpawnGUI.Finish.Status.Text = "You must be LD+ to drive this bus!"
game.Players:FindFirstChild(tostring(player)).PlayerGui.SpawnGUI.Finish.Status.Text = "You are suspended and cannot drive!"
game.Players:FindFirstChild(tostring(player)).PlayerGui.SpawnGUI.Finish.Status.Text = "Error: Server unauthorised your request."

Any help is appreciated!

Many thanks :)

0
Is the top your local script(client) and the bottom your script(server)? teeth3444444444 0 — 5y
0
in your first line, you use "player.Name" in FindFirstChild, in all lines below, you use "player". I dont think you can FindFirstChild from a player object TomAndelson 258 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

in your first line, you use "player.Name" in FindFirstChild,

game.Players:FindFirstChild(tostring(player.Name))

in all lines below, you use "player". I dont think you can FindFirstChild from a player object

game.Players:FindFirstChild(tostring(player)).

0
tried that, not working MrTomasboy 13 — 5y
Ad

Answer this question