Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this script not make the frame visible depending on the local players platform?

Here's the script, in a localscript in StarterGui

local player = game.Players.LocalPlayer --Variable for the player
local Pc = game.ReplicatedStorage.MainGui.Pc --Variable for the gui
local Xbox = game.ReplicatedStorage.MainGui.Xbox

if game:GetService("UserInputService").GamepadEnabled then
		Xbox:Clone().Parent = player.PlayerGui
			Xbox.Visible = true

if game:GetService("UserInputService").KeyboardEnabled then			
		Pc:Clone().Parent = player.PlayerGui
			Pc.Visible = true 
			end
		end
	end
end

Please let me know what I've done incorrectly. Thank you.

1 answer

✓ Accepted answer

You have to parent the screen gui to player gui, not just frame.

Simple fix would be to just put those frames in one screen gui, then clone a screen gui and parent it to player gui, and then access one of those frames and set it's visible property to true.

1 comment

0

Could you possibly edit my code to what it should be please?

This discussion is preserved as it was. New answers, comments, and votes are closed.