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

trying to fire a remote event in a repeat loop and won’t work?

I’m trying to make it so that it always checks their score and character name to know when to fire a remote event to change their character, however this isn't working. can you see any problems?

repeat 
	wait(0.1)
	if Player.leaderstats.Mass.Value < 16 and not Player.Character == "Bacteria" then
			
		game.ReplicatedStorage.ChangeChar:FireServer(game.ReplicatedStorage.Bacteria)

		print(Player.Character)
	end
until Player.leaderstats.Mass.Value > 15

repeat
	wait(0.1)
	if Player.leaderstats.Mass.Value > 15 and Player.leaderstats.Mass.Value < 31 and not Player.Character == "Virus" then
		
		game.ReplicatedStorage.ChangeChar:FireServer(game.ReplicatedStorage.Virus)

		print(Player.Character)

	end
until Player.leaderstats.Mass.Value > 30

5 comments

0

Is there any errors showing?

0

none at all, it just doesnt work

0

maybe its a problem with your remotes or checks, try making them run without any if statements.

0

yeah I have done that and it fires the remote perfectly which is very weird

0

probably your checks.

1 answer

✓ Accepted answer

The problem here is your checks as i have discussed separately in comments with you, you need to make more accurate or precise checks to counter this problem.

3 comments

0

ill give it a go

0

try using one value

0

the only problem is I need to have the second part to check their name otherwise it fires the event over and over

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