computer-sciencegame-enginestartuprobloxsolution# How do i make a roblox script start as soon as a player joins the game?

```
local Theme = workspace.CrucibleMusic1
local FlashEffect = script.Parent.FlashEffect
local Camera = workspace.Camera
local ScreenZoomAmount = 0.025 -- How much screen zoom when music is playing
local FlashAmount = 0.75 -- How much screen flash when music is playing
local ScreenAngelsAmount = 0.003 -- How much screen angles change when music is playing
local StandardFieldOfView = 70 -- Standard FieldOfView on roblox better set it to 70
game:GetService("RunService").RenderStepped:Connect(function()
Camera.FieldOfView = StandardFieldOfView - Theme.PlaybackLoudness * ScreenZoomAmount
FlashEffect.BackgroundTransparency = 1 - Theme.PlaybackLoudness * FlashAmount
Camera.CFrame = workspace.Camera.CFrame * CFrame.Angles(0,
0, math.rad(math.random(- Theme.PlaybackLoudness,
Theme.PlaybackLoudness) * ScreenAngelsAmount)) + Vector3.new(
math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount ),
math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount ),
math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount )
)
end)
```

How do i make this instantly start when i join? Im trying to figure out how to make this instantly start when a player joins the game, But i cant figure out how to do that. I tried putting it in ServerScriptService but it wouldnt run, Any ideas?

Solution

If the code is put in StarterPlayerScripts or something similar, the script is replicated and is already running on startup. ServerScriptService is for *server scripts*. They run on the server, not the client.

- Way to go from recursion to iteration
- Does anybody know from where the "layer of abstraction"/"layer of indirection" quote emerged?
- why is in my msp430g2553 microcontroller, char 'c' stored as ff63 but not as 0063?
- Prove that (p → q) → ((r ∨ p) → (r ∨ q)) is a tautology without using truth table
- Turing machine vs Von Neuman machine
- Encrypting a letter with RSA
- Sorting a list based on instructions in Javascript
- What are the differences between NP, NP-Complete and NP-Hard?
- How to calculate the memory size of a page table for a single process?
- MIPS pipeline avoids some data hazards by doing write-back in the first half cycle? Do other stages run in half-cycles?
- Why different result? float vs double
- Potential optimizations for frequently repeating Dijkstra's algorithm?
- Range sum of a BST
- What is a lambda (function)?
- Implementing algorithm to find all rotations for the stable marriage problem
- Building the docker image results in error while running "docker build -t file-name ."
- Dynamic programming problem for minimum cost tower placement
- Is a Family Tree considered a Tree in computer science?
- What is the importance of 1's complement and 2's complement in Binary
- How are extremely large numbers handled?
- length function without recursion ocaml
- Is the language {0^n 1^n 0^k | k != n} context free?
- Use the 8-bit version of the IEEE 754 floating point format to find the representation of 32 to the base 10
- How would I write the getter and setter methods for my class?
- The definition of the literal
- What exactly does big Ө notation represent?
- Why is array element referencing a constant time operation?
- Leetcode bug? (Function isn't stopping even after it returns in binary search)
- How do i make a roblox script start as soon as a player joins the game?
- C++ Precedence and Associativity