I am am making a script that when you press something, a textbutton pops up and a imagelabel closes. However, it says that it is not a part of the player gui. Here is my script:
game.Players.PlayerAdded:Connect(function(playerr) game.ReplicatedStorage.ex1.OnServerEvent:Connect(function(player) print(player) local c = "Welcome to the F18 Immunity Challenge! " game.ReplicatedStorage.ex:FireAllClients(player, c) playerr.PlayerGui.ex.TextButton.Visible = false wait(10.2) end) end)
This is the error: https://gyazo.com/d2b270d761ec9f7c45be8a9fe842b7ab
Here is proof it is in gui:
https://gyazo.com/4f758831305b1d977e98a1e1fcb0b43c
Please help!
Hi zValerian! I'm here to explain you why that not work. It's simple, you can't change a client element with the server. So for fix this, create a LocalScript and write this.
local PlayerService = game:GetService('Players') local Player = PlayerService.LocalPlayer game.ReplicatedStorage.ex.OnClientEvent:Connect(function() Player.PlayerGui.ex.TextButton.Visible = false end)
and in your ServerScript delete this
playerr.PlayerGui.ex.TextButton.Visible = false
Because it's not possible
If it's not this so explain me what do you create