the script fails when playtesting, it's basically a launch command, it's supposed to open up a GUI stating the rules but when saying "!rules" a GUI doesn't show up or get sent to your PlayerGUI.

My script:

function OnChatted(msg, speaker)
	end
source = string.lower(speaker.Name)
msg = string.lower(msg)
if msg == "!rules" then
local gui = script.rules:Clone()
gui.Parent = localplayer.PlayerGUI
gui.Enabled = true
end

2 comments

1

Use a code block to make your code more readable

0

Maybe instead, put it in StarterGui and make it enabled when the command was said.