What is the issue? Include screenshots / videos if possible!
Line 61 no errors it wont receive the remote event for some reason
the other events I use work
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried googling similar problems but non fixed it
Local script in StarterPlayerScripts
Server script in Workspace
local Players = game:GetService("Players")
local GameStartedValue = game.Workspace.GameStarted
local SS = game:GetService("ServerStorage")
local RS = game:GetService("ReplicatedStorage")
local function gamestart()
if game.Workspace.GameStarted.Value == false then
GameStartedValue.Value = true
for keyvalue, player in pairs(Players:GetPlayers()) do
local num = math.random(1,5)
if workspace.Seats:FindFirstChild(num).Value.Value == "None" then
workspace.Seats:FindFirstChild(num).Value.Value = player.Name
workspace.Seats:FindFirstChild(num):Sit(player.Character.Humanoid)
local PlayerNumberSeat = Instance.new("NumberValue")
PlayerNumberSeat.Value = num
PlayerNumberSeat.Parent = player.Character
player.Character:FindFirstChild("PlayerInGame").Value = true
end
end
end
end
local function PlayerCountChecker()
if #Players:GetPlayers() > 0 then
RS.Intermisson:FireAllClients()
task.delay(12, gamestart)
else
RS.NotEnoughPlayers:FireAllClients(1)
end
end
Players.PlayerAdded:Connect(PlayerCountChecker)
Players.PlayerRemoving:Connect(PlayerCountChecker)
workspace.GameStarted.Changed:Connect(function()
if workspace.GameStarted.Value == true then
local RandomPlayer = Players:GetPlayers()[math.random(#Players:GetPlayers())]
repeat wait() until RandomPlayer.Character:WaitForChild("PlayerInGame").Value == true
if RandomPlayer.Character:WaitForChild("PlayerInGame").Value == true then
RS.PickPlayer:FireClient(RandomPlayer)
local RandomPlayerWork = workspace:FindFirstChild(RandomPlayer.Name)
local WeaponAim = SS.LocalLookingAroundScript:Clone()
WeaponAim.Disabled = false
WeaponAim.Parent = RandomPlayerWork
print(RandomPlayer.Name)
local Deagle = SS.Deagle:Clone()
Deagle.Parent = RandomPlayerWork
RS.PickPlayer:FireClient(RandomPlayer)
------------------------------------------------------------------------------------------------------------
RS.PickPlayer.OnServerEvent:Connect(function()
local SeatNumber = RandomPlayerWork.Value.Value + 1
local playerSeat = workspace.Seats:FindFirstChild(SeatNumber)
repeat wait() until playerSeat.Occupant ~= nil
if playerSeat.Occupant ~= nil then
local playerName = playerSeat.Value.Value
local Nextplayer = workspace:FindFirstChild(playerName)
local WeaponAim = SS.LocalLookingAroundScript:Clone()
WeaponAim.Disabled = false
WeaponAim.Parent = Nextplayer
print(RandomPlayer.Name)
Deagle.Parent = Nextplayer
RS.Fire.OnServerEvent:Connect(function(player)
local player2 = Deagle.Parent
print("Worked")
player2.RightUpperArm.Orientation = player2.RightUpperArm.Orientation + Vector3.new(0,50)
player2.RightLowerArm.Orientation = player2.RightLowerArm.Orientation + Vector3.new(0,50)
player2.RightHand.Orientation = player2.RightHand.Orientation + Vector3.new(0,50)
player2.RightUpperArm = player2.RightUpperArm + Vector3.new(0.2,0.5,0)
player2.RightLowerArm = player2.RightLowerArm + Vector3.new(0.2,0.5,0)
player2.RightHand = player2.RightHand + Vector3.new(0.2,0.5,0)
local shootable = true
----------------------------------------------------------------------------------------------------------------------
Deagle.Activated:Connect(function()
if shootable == true then
print("WORKED")
shootable = false
local bullet = game.ServerStorage.Bullet:Clone()
bullet.Parent = game.Workspace
bullet.Position = Deagle.ShootPoint
bullet.Orientation = Deagle.ShootPoint
bullet.Touched:Connect(function(hit)
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid") - math.random(99,100)
bullet:Destroy()
print("Yes3")
Deagle.Equipped:Connect(function()
print("DeagleEquipped")
Deagle.Parent.Humanoid:LoadAnimation(script.Animation):Play()
end)
end)
end
end)
end)
end
end)
end
end
end)
The way you are using Remote events is very strange.
First of all, your PickPlayer Event does not have any parameters, where it should include the player object.
This means that any player can fire that Event before the Random Player you’ve selected fires it back.
Also, you’reFiring the client side before creating your server side connection.
This means of the client fires before the server connection to the event is created, it will be missed.
First of all, add a print to your client side when you’re about to respond to the server - validate that is actually firing first.
Second, on the server side, add the Player parameter to the PickPlayer Event so you can validate that the correct player is responding.
Finally, only request a response after creating the server connection to that remote Event.