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

Weird errors involving RemoteEvents?

Asked by
lomo0987 250 Moderation Voter
8 years ago

I've been trying to make scripts that revolve around RemoteEvents, Everything is set up and should work but it doesn't seem to want to fully work. It seems like it can't get the variables i'm sending to the other script.

Here is the script on the players end

function Clicked()
    print("Clicked!")
    local Edit = script.Parent.Parent
    game.Lighting.GamePlay:FireServer(Edit)
end

script.Parent.MouseButton1Click:connect(Clicked)

Here is the script on the servers end

XP = game.ServerStorage.XPBar

function Change(Player,Edit)
    print(Player.Name.." Has Started to Play!")
    Player.Play.Value = 1
    local Give = XP:Clone()
    Give.Parent = Player.PlayerGui
    Edit.Visible = false
end

game.Lighting.GamePlay.OnServerEvent:connect(Change)

EVERYTHING works until line 8, "Edit.Visible = false". It can't get "Edit" as a variable. My other scripts are acting like this too, it works until it gets to the variables.

Answer this question