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

Why does this work in studio only?

Asked by 8 years ago
    if player:IsA("Player") then
        player.Backpack.NameChange:FireClient(player)
            print("7")
    end
script.Changedd.OnServerEvent:connect(function()   --This is a script in Workspace. The part not working. (FE enabled.)
        if player.PlayerGui.ScreenGui.MainFrame.PlayerName.Text ~= "" then
    player.leaderstats.Character.Value = player.PlayerGui.ScreenGui.MainFrame.PlayerName.Text
    player.Character.Head.BillboardGui.MainFrame.PlayerLabel.Text = (player.PlayerGui.ScreenGui.MainFrame.PlayerName.Text)
    print("8")
    end

    if player.PlayerGui.ScreenGui.MainFrame.Occupation.Text ~= "" then
    player.leaderstats.Occupation.Value = player.PlayerGui.ScreenGui.MainFrame.Occupation.Text
    player.Character.Head.BillboardGui.MainFrame.OccupationLabel.Text = (player.PlayerGui.ScreenGui.MainFrame.Occupation.Text)
    print("9")
        end
    end)
    end)
end)
local event = script.Parent.Parent.Parent.Parent.Parent.Backpack:WaitForChild("NameChange")
    print("10")
event.OnClientEvent:connect(function(player)
        print("11")
script.Parent.MouseButton1Click:connect(function(click)
    print("12")
    game.Workspace.NamingCore.Changedd:FireServer()

end)
end) --This is what triggers the event or should at least in the script above this one.
--What could of I possibly done wrong, and if so. Please explain what I did wrong ^^;
--This is a local script inside of a TextButton, inside of a frame, inside of a screenGui.
--The event NameChange is in StarterPack and Changedd is created by NamingCore once the server starts up. Putting the event inside itself.
0
press f9 in the game, and look through all the tabs to see what the error is, if there isn't an error, specify that there isn't. theCJarmy7 1293 — 8y
0
Okay, there isn't any errors. It just doesn't print 8 or 9 on the server. Vingam_Securis 213 — 8y

Answer this question