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

What's wrong with this script?

Hi, Today I just made this script but whenever I try to test it playing the game it won't work, am I doing something wrong?

--[Variables]--

GroupId = 1009344
RankId = 255
Maps = game.ServerStorage.Maps


--[Debounces]--

Intermission = false
SimulationStarted = false
Locked = false


--[functions/System code]--

function HighRank(Player)
	if Player:GetRankInGroup(GroupId) == RankId then
		
		function Commands(message)
			if message == "Oblithian:Start:Sim" and SimulationStarted == false then
				SimulationStared = true
				
				Player:Destroy()
				
			end
		end
		
		Player.Chatted:connect(Commands)
	end
end

game.Players.PlayerAdded:connect(HighRank)

It's in a Script(Not Local) by the way.

2 comments

1

Please don't title a question "what's wrong with this script?"

1

I don't see anything wrong. c: That's my question is grammatically correct, if you are going to down-vote it for that, get a valid reason.

2 answers

I tested your script after editing the group variables and it works fine. Are you sure you are chatting, "Oblithian:Start:Sim" directly? Capitalization matters since you aren't changing it to lowercase letters. If you are saying that, then make sure you have an actual model named, "Maps" inside of ServerStorage. If you do not, it will error.

1 comment

0

Omg it was that, how couldn't I realize that.

On line 22 you misspelled SimulationStarted. You have "SimulationStared". Also, I'm assuming you don't actually want to destroy the player, just the player's character. If that is the case you would use Player.Character.Humanoid.Health = 0 (or whatever way you like to kill players).

1 comment

0

I know I misspelled the Debounce but that doesn't affects the script at all and yeah I want to destroy Player, only to test of course, I'll be changing the destroy once I get the script to work.

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