Scripting a gui to make the map go disco (Like the admin command :Disco)

That unfortunately didn’t work.

Ill set the value and try that right now,

The isDisco value needs to be defined by something first before that while loop can work

I have defined it haven’t I? At the top. ‘Local isDisco;’ Also means, local isDisco = false

No, it’s defining it as a nil value
Just change local isDisco; to this local isDisco = false and see if any changes are made

Alright. Will do. Thank you. .

Oh yeah another thing: You can add print statements as well to see where your line of code stops

Nice!! I’ll add it in, also changing it to local isDisco = false, that hasn’t changed anything.

Nothing is even printing, I don’t think the script it even running.

image

That should work, even if he doesn’t define it as anything.

Player.Team returns a Team instance, not the team name. You are comparing an instance to a string

Player.Team.Name is what you are looking for: Player.Team

Alright, let me try that right now please bare with me.

Correction - You are comparing the Player.Team to the Team instance, that is not the problem. I misread your code.

The only thing I can think of is that the script is disabled, or you are not firing the remote event from a client at all.

Ive edited it and Ive checked nothing is disabled.

Thats the fire event with the explorer.

Edit that back, that was my mistake. Please see this screenshot:

Screenshot

Your localscript tries to fire script.Parent.toggleDisco but that doesn’t exist in your screenshot. It should be firing ReplicatedStorage.toggleDisco

Edit: as below stated, please make sure your output window is visible - this would’ve been immediately clear to you if you noticed the error in the output window.

3 Likes

Try adding print statements to the local script? The problem might be lying somewhere in-between lines 5 or 6 of your Server Event code (Also make sure that you know where your Output is)

1 Like
2 Likes

Thank you ill do that right away.

1 Like

In your ServerScript, you should change “teamName” on line 7 to your actual team name, unless it is actually named teamName.

Now in your LocalScript, you should have the correct path to the Remote. In the ServerScript, the path points to ReplicatedStorage, while in the LocalScript it points to script.Parent.

You are correct, it is supposed to be a Color3 value, but in his code he is converting the BrickColor to a Color3.

This is incorrect as the not operator always returns true or false.

print(not nil)      --> true
print(not false)    --> true
print(not 0)        --> false
print(not not nil)  --> false

Ref: https://www.lua.org/pil/3.3.html

Hope this helped :slight_smile:

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.