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

Why doesn't my FE-converted script work? (UI)

Asked by
Talveka 31
5 years ago

Ive converted my name GUI script to FE. It adds an " | " sign to the name, however it doesnt show it to other players.

First part, aka LocalScript.

script.Parent.MouseButton1Down:Connect(function()
        local player = game.Players.LocalPlayer
        local takeme = script.Parent
        local hands = player.Character:WaitForChild("Part") 
        if hands then
        print 'yeee name exists'
        local nyee = hands.BillboardGui.NAME
        nyee.Text = (nyee.Text.. " | ")
        local rm = script.Parent.RemoteEvent
        rm:FireServer(player,takeme)
        end
    end)

I have a custom part inside the player, inside that part is a BillboardGui. The custom part appears as soon as the player spawns.

Second part,this time being a Script.

local rm = script.Parent.RemoteEvent
    rm.OnServerEvent:Connect(function(player,takeme)
end)

I've tried taking half the code out of the localscript (i took out everything after 'if hands then') and putting it into the other script, however it quit working at all.

The script works partially, even outputs the printed text but just doesn't show the name to other players.

1 answer

Log in to vote
0
Answered by
Audiimo 105
5 years ago

If you have FE enabled anything you do on a local script will not effect the surrounding world of yours. Only client sided changes will effect the client and no one else. Client makes changes --> Server Checks if its okay, if so ---> All Clients Get The Change. Anway, You'll want to make the name change in the server script you have that runs when the RemoteEvent is activated. First lets change this local script. I saw you said you took half and put it in the other but I dunno if you tried this.

script.Parent.MouseButton1Down:Connect(function()
    local player = game.Players.LocalPlayer
    local takeme = script.Parent
    local hands = player.Character:WaitForChild("Part")
    if hands then
        print ('yeee name exists')
        rm:FireServer(player, hands, takeme )
    end
end)

Now the server Script.

local rm = script.Parent.RemoteEvent
rm.OnServerEvent:Connect(function(player, hands, takeme )
    local nyee = hands.BillboardGui.NAME
    nyee.Text = (nyee.Text.. " | ")
    local rm = script.Parent.RemoteEvent
end)

Assuming the script is also in the same location as the local script this is what i've done. If the script is somewhere else please inform me and I will make the corrections necessary.

0
In order to correct this I need to know where something is located via your Explorer. My discord is Autizmos#3556 so if you want help just DM me! Audiimo 105 — 5y
0
Yes, the path was correct but now the script stops working at all. Even in studio mode where it would normally work. I wish i had access to devforum or something, lol. Talveka 31 — 5y
0
Does the local script print, if so add a print in the server script and see if it prints when the event is fired. Audiimo 105 — 5y
0
It doesnt seem to print anything. Talveka 31 — 5y
View all comments (2 more)
0
if the local script worked before the change it should work now. All i did was move some code in the if statement into the server script. Whats your output? Audiimo 105 — 5y
0
Alright, i managed to get the script to work in Studio. Turns out i defined the path of the BillboardGui wrong, but it still does not work in FE even after fixes. Talveka 31 — 5y
Ad

Answer this question