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

How would I verify this serversided?

I'm making a command script for a training place, how would I verify if the player is in the group server sided? Like a check if the player is in a certain group at a certain rank. People with exploits fire this remote a lot.

Client
game.Players.LocalPlayer.Chatted:connect(function(msg)
	local player = game.Players.LocalPlayer
	local rank = player:GetRankInGroup(474547)
	if rank >= 10 then
if  msg:sub(1,6)==":load " then
			local map = msg:sub(7,msg:len())
			print(map)
			game.ReplicatedStorage.Events.LoadMap:FireServer(map)
		end
Server
game.ReplicatedStorage.Events.LoadMap.OnServerEvent:connect(function(player,map)
	local bricks = game.ServerStorage.Maps:FindFirstChild(map) 

1 answer

✓ Accepted answer

Nesting the Chatted Event


What you can do is just nest the chatted event inside a playeradded event and handle the entire thing on the server.

Like such:

game.Players.PlayedAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		local rank = player:GetRankInGroup(474547)
		if rank >= 10 then
			if msg:sub(1,6) ==":load " then
				local map = msg:sub(7,msg:len())
				local bricks = game.ServerStorage.Maps:FindFirstChild(map) 
			end
		end
	end)
end)

Hopefully this helped!

1 comment

0

tysm

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