generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

My script won't Work. SOMEONE HELP ME!

Previous Thread :: Next Thread 
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
04 Aug 2011 04:37 AM
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local humanoid = player.Character:FindFirstChild("Humanoid")
function OnPlayerAdded(player)
wait(5)
local part = Instance.new("Part")
part.Parent = game.Workspace
part.Cframe = Cframe.new(game.Workspace.PIE.Position)--PIE is a brick in the Workspace
part.Transparency = 1
part.CanCollide = false
camera.CameraSubject = game.Workspace.part
camera.CameraType = "Attach"
wait(10)
camera.CameraSubject = humanoid
camera.CameraType = "Custom"
end
----------------------------------------------------------------------------
The above script is in a localscript and is meant to change the current camera view to a brick in the workspace called PIE. However, I don't know what went wrong as it isn't working.Someone, please help me!
Report Abuse
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
04 Aug 2011 04:38 AM
Send me a message if possible or write in the forum but i would appreciate messages
Report Abuse
Megolas is not online. Megolas
Joined: 16 Jan 2011
Total Posts: 357
04 Aug 2011 04:48 AM
is the script inside player/character? Also, is there any output? Give us a starting point ;)
Report Abuse
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
07 Aug 2011 02:52 AM
Well, the script is in workspace but how do i put it in player/character? I thought it was already wriiten down in the script
Report Abuse
scepile3 is not online. scepile3
Joined: 27 Feb 2009
Total Posts: 260
07 Aug 2011 03:04 AM
'.' This script is... strange. In the first lines you have:
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera

Which would only work in a local script. Later you have:
function OnPlayerAdded(player)

which is just a generic function named OnPlayerAdded. If you were planning to use an event for this, it doesn't make sense...
Why would you try to use two ways of getting the player, when those ways aren't compatible?

Also, Cframe is supposed to be spelled CFrame in the following line:
part.Cframe = Cframe.new(game.Workspace.PIE.Position)--PIE is a brick in the Workspace

Caps do matter. '.'
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
07 Aug 2011 03:58 AM
Add the connection line aswell

game.Players.ChildAdded:connect(OnPlayerAdded)

Report Abuse
EverquestI is not online. EverquestI
Joined: 03 Feb 2011
Total Posts: 11109
07 Aug 2011 03:59 AM
Well you aren't calling the function anywhere
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image