Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Difference from Run and Play?

I've been trying to make a camera scriptable in game but it wont do it if i push play but if I use Run it works.

Here's my script


local Dice = script.Parent
local Cam = workspace.CurrentCamera
local Object = game.Workspace.Part

Object.CanCollide = false
Object.Anchored = true

wait(1)
repeat wait()
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
until game.Workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
	
Cam.CFrame = workspace.CamPart.CFrame

Object.Orientation = Vector3.new(0, 0, 90)

Dice.Orientation = Vector3.new(math.random(0, 360), math.random(0, 360), math.random(0, 360))
wait(5)
Dice.Anchored = false
wait(10)
Dice.Anchored = true
wait(0.1)
Object.Position = workspace.Union.Position
wait(0.1)
Cam.CFrame = CFrame.new(Dice.Position + Vector3.new(0,30,0), Dice.Position) -- changes the position of camera above the dice 
wait(5) -- You can change it to however long you want it to hover
Cam.CameraType = Enum.CameraType.Custom -- Changes the camera back to player


3 comments

0

"Play" adds a client to the test-server (your player, character, etc.), whereas "Run" runs server-side code (doesn't join a client to the local test-server).

0

Is this in a server script or a local script?

0

its jusst a normal script under a object

1 answer

✓ Accepted answer

If you click run, your character won't be there, if you click play, your character will be there meaning it's like you're playing a roblox game while play is just like you're a camera walking around and test things

This discussion is preserved as it was. New answers, comments, and votes are closed.