i made a chat script that teleports me to a friend when i type a command out but it says that chat is not a valid memeber of playergui any idea on how to fix this?
if game.Players:FindFirstChild("kleppolek") then
if game.Players.kleppolek.PlayerGui.ChatFrame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar.Text == "/me wk" then
game.Players.klepplek.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.world_kiIIer.Head.Position)
end
end
if game.Players:FindFirstChild("world_kiIIer") then
if game.Players.world_kiIIer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar.Text == "/me klep" then
game.Players.world_kiIIer.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.kleppolek.Head.Position)
end
end
also when we tested the game in roblox servers it said that player gui is not a valid member of payer, why? this is a local script inside starterpack

2 comments
I read on one of the answers on here once that "The server cannot see the descendants of playergui which is clientside" or so I think
the script is a client side and so is the playergui so it should see