Yet another infinite yield problem with :WaitForChild()

Just like every other infinite yield problem out there, It infinite yields upon attempting to require the Ez Camera Shake module from serverscriptservice, here:

if not game:IsLoaded() then
	game.Loaded:Wait()
end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ContextActionService = game:GetService("ContextActionService")
local ServerScriptService = game:GetService("ServerScriptService")
local runService = game:GetService("RunService")
local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
	character = player.CharacterAdded:wait()
end
local mouse = player:GetMouse()
local Root = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local HumRoot = character:WaitForChild("HumanoidRootPart")
local animator = humanoid:WaitForChild("Animator")
local tool = script.Parent --
local gui = player.PlayerGui:WaitForChild("Attacks")
local CameraShaker = require(game:GetService("ServerScriptService"):WaitForChild("CameraShaker")) -- errors infinite yield here
local camera = workspace.CurrentCamera

image

Infinite yield possible on 'ServerScriptService:WaitForChild("CameraShakere")'  -  Studio

sorry for lack of info, i couldnt seem to solve this problem with other posts solutions.

what?? there looks like there is a lot wrong with this code.

This looks like it is meant to be a LocalScript.

You can’t access the contents ServerScriptService from the client. Also you are spelling CameraShaker as CameraShakerein your code.

1 Like

that was just me trying to rename it and see if it does anything

oh… so how would the camer shake module work then…??? sorry idk if u use he module

Put the module in somewhere the client can access, such as StarterPlayerScripts or ReplicatedStorage

I put in rep storage and it stilll infinite yielded

Eh nvm i did something dumb. Thanks :slight_smile: