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
 

Re: Why is it giving me an error?

Previous Thread :: Next Thread 
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
20 Apr 2014 05:12 PM
Error: '=' expected near 'local'

Script:

local distance= 20

wait(.5)
while not game.Players.LocalPlayer.Character:FindFirstChild ("Right Arm") do wait() end
local cam= workspace.CurrentCamera
cam.CameraType= 'Custom'
cam.CameraType= 'Scriptable'
local right arm= game.Players.LocalPlayer.Character.Right Arm

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(rightarm.Position.x + 10, rightarm.Position.y + distance, rightarm.Position.Z + 10),rightarm.Position)
end
Report Abuse
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
20 Apr 2014 05:23 PM
Bump
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 Apr 2014 05:25 PM
"while not game.Players.LocalPlayer.Character:FindFirstChild ("Right Arm") do wait() end"
Ew... just do this:

while game.Players.LocalPlayer.Character:FindFirstChild("Right Arm") do

Then add another end at the end of the script.

Here's my siggy... Done.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:25 PM
This should work now:
local distance= 20

wait(.5)
while not game.Players.LocalPlayer.Character:FindFirstChild ["Right Arm"] do wait() end
local cam= workspace.CurrentCamera
cam.CameraType= 'Custom'
cam.CameraType= 'Scriptable'
local right arm = game.Players.LocalPlayer.Character["Right Arm"]

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(rightarm.Position.x + 10, rightarm.Position.y + distance, rightarm.Position.Z + 10),rightarm.Position)
end
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 Apr 2014 05:25 PM
And also, don't forget a wait(), otherwise roblox will crash when you test the script.

Here's my siggy... Done.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 Apr 2014 05:26 PM
Ignore me, I'm going to sleep. XD

Here's my siggy... Done.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:26 PM
@Sprongo, when I went on studio to see what line the error was, and I did type end again and it get me an error.
Report Abuse
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
20 Apr 2014 05:26 PM
Thanks.
[thread closed/]
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:26 PM
Oh lol, Sprongo, have you seen the "Go to sleep" vine. It's so funny.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 Apr 2014 05:27 PM
@youssef Read above your post.
And also, my name is Spongo, not Sprongo. XD

Here's my siggy... Done.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:28 PM
My bad, I just passed 666 forum posts, and I have a fire hat on. AGH SATIN
Report Abuse
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
20 Apr 2014 05:35 PM
wait, @yousself04

local distance= 20

wait(.5)
while not game.Players.LocalPlayer.Character:FindFirstChild ["Right Arm"] do wait() end
local cam= workspace.CurrentCamera
cam.CameraType= 'Custom'
cam.CameraType= 'Scriptable'
local right arm = game.Players.LocalPlayer.Character["Right Arm"]

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(rightarm.Position.x + 10, rightarm.Position.y + distance, rightarm.Position.Z + 10),rightarm.Position)
end

The script gives me an error on line 4 (while not game.Players.LocalPlayer.Character:FindFirstChild ["Right Arm"] do wait() end) Error: function arguments expected near '['
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:38 PM
DO NOT CHANGE ANYTHING

local distance= 20

wait(.5)
while not game.Players.LocalPlayer.Character:FindFirstChild ["Right Arm"] do wait() end
local cam= workspace.CurrentCamera
cam.CameraType= 'Custom'
cam.CameraType= 'Scriptable'
local rightarm = game.Players.LocalPlayer["Right Arm"]

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(rightarm.Position.x + 10, rightarm.Position.y + distance, rightarm.Position.Z + 10),rightarm.Position)
end
Report Abuse
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
20 Apr 2014 05:38 PM
I didn't
It's STILL giving me an error.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:39 PM
THIS ONE SHOULD WORK HOPEFULLY, NOT THE OTHER ONE

local distance= 20

wait(.5)
while not game.Players.LocalPlayer:FindFirstChild["Right Arm"] do wait() end
local cam= workspace.CurrentCamera
cam.CameraType= 'Custom'
cam.CameraType= 'Scriptable'
local rightarm = game.Players.LocalPlayer["Right Arm"]

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(rightarm.Position.x + 10, rightarm.Position.y + distance, rightarm.Position.Z + 10),rightarm.Position)
end
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:39 PM
I didn't realise the error was on line 4, but the other one should work.
Report Abuse
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
20 Apr 2014 05:41 PM
For some reason it gives me the same error :C
I'm pretty sure that's the same script, though.
Report Abuse
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
20 Apr 2014 05:42 PM
Nevermind, not the same script.
But still the same error
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:43 PM
I removed character.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
20 Apr 2014 05:50 PM
I took your script, gave it my script potion, it should work now, I put it in studio, editted it and now there is no error, here is the script:

local distance= 20

wait(.5)
while not game.Players.LocalPlayer["Right Arm"] do wait() end
local cam = workspace.CurrentCamera
cam.CameraType= 'Custom'
cam.CameraType= 'Scriptable'
local right arm = game.Players.LocalPlayer.Character["Right Arm"]

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(rightarm.Position.x + 10, rightarm.Position.y + distance, rightarm.Position.Z + 10),rightarm.Position)
end
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
21 Apr 2014 02:46 AM
@youssef Variables can't have spaces, I believe.
@OP Try this:

wait(.5)
while not game.Players.LocalPlayer.Character:FindFirstChild("Right Arm") do wait() end
local cam = workspace.CurrentCamera
cam.CameraType= 'Custom'
cam.CameraType= 'Scriptable'
local rarm = game.Players.LocalPlayer.Character["Right Arm"]

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(rarm.Position.x + 10, rarm.Position.y + distance, rarm.Position.Z + 10),rarm.Position)
end

Here's my siggy... Done.
Report Abuse
Kloiz is not online. Kloiz
Joined: 29 Jan 2010
Total Posts: 378
21 Apr 2014 12:24 PM
@Spongo

It doesn't work.
Try your script in studio.
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