I want the bool value to be created in order to check whether the player is local or not, but the fact is that the value is always true, I roughly understand why it is always true
Server Code:
local RP = game:GetService("ReplicatedStorage")
local Remotes = RP:WaitForChild("Remotes")
local Remote = Remotes.CHECKLPLR
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
function Checking(Bool, LocalPlayer)
if LocalPlayer then
Bool.Value = true
else
Bool.Value = false
end
end
Remote.OnServerEvent:Connect(function(LocalPlayer)
local Bool = Instance.new("BoolValue")
Bool.Name = "CheckLocal"
Bool.Value = false
Bool.Parent = LocalPlayer.Character
RunService.Heartbeat:Connect(function()
Checking(Bool, LocalPlayer)
end)
end)
Local code:
local RP = game:GetService("ReplicatedStorage")
local Remotes = RP:WaitForChild("Remotes")
local Remote = Remotes.CHECKLPLR
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
LocalPlayer.CharacterAdded:Connect(function()
Remote:FireServer(LocalPlayer)
end)