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

Frame value doesn't change?

So for some reason this does not change the value of this Frame please help me!

	Player.Chatted:connect(function(message)
		if message:lower() == "skip" then
			if groupId > 0 then
game.StarterGui.NoPerms.Frame.Visible = true
wait(3)
game.StarterGui.NoPerms.Frame.Visible = false

7 comments

0

Can you send the whole script?

0

I have sent you the whole script.

0

uh, it's broken. There's no linespace in it and i cant understand.

1

You're changing the value of the frame in the starter gui. Guis are cloned from the starter gui into the player. They won't get the new gui with the invisible frame until they reset. Instead, change the PLAYERS frame.

0

Could you explain this with the script so I could copy and paste it?

0

yeah ok

0

So, maybe add an "end)" when closing your if statement? That's probably the problem.

3 answers

✓ Accepted answer

Here's the example I was talking about:

My only concern is I don't know what if groupId > 0 then is so I commented it out for now Could you explain that a bit more? If this doesn't work we can team create.

Here is how you would do it from a server (normal) script:

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		local playerSaidSkip = message:lower() == "skip"

		if playerSaidSkip  --[[and groupId > 0 ]]  then
			player.PlayerGui.NoPerms.Frame.Visible = true
			wait(3)
			player.PlayerGui.NoPerms.Frame.Visible = false
		end
	end)
end)

You can do this from a local script too: make sure you put the local script directly inside the NoPerms gui in the startergui

local player = game:GetService("Players").LocalPlayer
local frame = script.Parent.Frame --since this script is inside the starter gui, we can reference the frame by saying script.Parent (the noperms gui) .Frame (the frame)

player.Chatted:Connect(function(message)
	local playerSaidSkip = message:lower() == "skip"
	
    if playerSaidSkip  --[[ and groupId > 0 ]] then
		frame.Visible = true
		wait(3)
		frame.Visible = false
	end
end)

4 comments

0

I'll try this

0

kk let me know what happens

0

we can team create if it doesnt work, pls don't give up!!

0

I'll send you the whole script on roblox.

Maybe the line space are not organised? After if group id > 0 then, the lines must be positioned under the groupid. It might look like it

    Player.Chatted:connect(function(message)
        if message:lower() == "skip" then
            if groupId > 0 then
                  game.StarterGui.NoPerms.Frame.Visible = true
                  wait(3)
                  game.StarterGui.NoPerms.Frame.Visible = false

I'm not sure about it.

1 comment

0

The group thing works fine. It does print things in the console if I try to do that.

Try this:


    Player.Chatted:connect(function(message)
local screen = Script.Parent.Parent.NoPerms.Frame  -- change this to your screen gui and dont use  game.parent!              
                                                                                  
        if message:lower() == "skip" then
            if groupId > 0 then
screen.Visible = true
wait(3)
screen.Visible = false

I hope this solved your issue.

5 comments

0

I'll thy this.

0

There is a problem. The script gets executed in the console so not inside the startergui

0

workspace, not console lol

0

Oof, then I dont know.

0

Thats fine

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