Sometimes when I join the game in Studio, my local script does not work at all. Sometimes it will work perfectly and load everything in while other times nothing will happen. Nothing is printed at all in the output. There is more but this is probably all that matters.
local replicatedStorage = game:GetService("ReplicatedStorage")
local inputService = game:GetService("UserInputService")
local Icon = require(replicatedStorage:WaitForChild("ModuleScripts").Icon)
local parkour = require(replicatedStorage:WaitForChild("ModuleScripts").Parkour)
local battlegrounds = require(replicatedStorage:WaitForChild("ModuleScripts").BattlegroundsClient)
local charEvent = replicatedStorage:WaitForChild("RemoteEvents").ChangeCharacterEvent
local punchEvent = replicatedStorage:WaitForChild("RemoteEvents").PunchEvent
local deb = false
local debTime = 0.5
local loadedIn = false
game.Players.PlayerAdded:Connect(function(plr)
print("fired")
if not loadedIn then
print("loaded")
parkour.init(game.Players.LocalPlayer)
battlegrounds.init()
end
end)
game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
if loadedIn then
parkour.reset(game.Players.LocalPlayer)
battlegrounds.reset()
end
end)