recently I made a script that checks a value in the client and sees if that value isn’t equal to the server value and then kicks them but I’m getting an error from it
-- Servies
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
-- RemoteEvent
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local function PlayerAdded(Player)
local ServerPlayerData = ReplicatedStorage:WaitForChild("ChangeValue")
Player.CharacterAdded:Connect(function()
RemoteEvent.OnServerEvent:Connect(function(Data,CilentPlayer)
if Data.Value == ServerPlayerData.Value then
print("Work")
else
Player:Kick("IntValue Was Changed")
end
end)
end)
end
Players.PlayerAdded:Connect(PlayerAdded)
Value is not a valid member of Player “Players.static2240”
I use a command bar to fire it.
game.ReplicatedStorage.CellShadeCilentToData:FireServer(game.ReplicatedStorage.ChangeValue, game.Players.static2240)