I want to give the player a bat when the game starts; however when I attempt to do so it starts the game but doesn’t give them a bat.
It produces no errors at all but prints it gave the player the bat. This method of checking worked for the start but not giving the bat?
Script
local replicatedstorage = game:GetService("ReplicatedStorage")
local eventmap = replicatedstorage.MapChosen
local serverstorage = game:GetService("ServerStorage")
local bat = serverstorage.Bat
local players = game:GetService("Players")
eventmap.OnServerEvent:Connect(function(batgive)
for i, player in pairs(players:GetPlayers()) do
if player.GameValues.InGame.Value == true then
print("gave players bat")
bat:Clone().Parent = player.Backpack
end
end
end)
Said script is inside ServerScriptService