This works in studio but not in game.
local Player = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera
local SS = game:WaitForChild("ServerStorage")
local Crate = SS.Crate
Ready = true
function OnClick()
if Ready == true then
Ready = false
local Pad = Instance.new("Part")
Pad.Name = "CrateLand"
Pad.Size = Vector3.new(5, 5, 5)
Pad.Anchored = true
Pad.CanCollide = false
Pad.Transparency = 0.5
Pad.BrickColor = BrickColor.new("Bright red")
Pad.Position = Vector3.new(Player.Character.Torso.Position.X +10, Player.Character.Torso.Position.Y, Player.Character.Torso.Position.Z)
Pad.Parent = Camera
local CrateCopy = Crate:Clone()
CrateCopy.PrimaryPart = CrateCopy.Main
CrateCopy.PrimaryPart.Position = Vector3.new(Camera.CrateLand.Position.X, Camera.CrateLand.Position.Y + 50, Camera.CrateLand.Position.Z)
CrateCopy.Parent = Camera
wait(5)
Camera:FindFirstChild("CrateLand"):Destroy()
Ready = true
end
end
script.Parent.MouseButton1Click:connect(OnClick)

3 comments
You can't use LocalPlayer in a regular script, it must be in a local script!
Nor can you use CurrentCamera in a regular script, it must also be in a local script!
It is a local script.