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: Anti-Zoom

Previous Thread :: Next Thread 
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 04:01 AM
How would i go about making a anti-zoom out script so u can only zoom out about 50 studs? ( If you try to zoom out more it re-zooms you back to 50 stud distance. )
Like what function or what would i need to make it i'm very new to using camera functions on roblox.
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 04:05 AM
Wiki link or anything will help i'm not sure what to search.
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 04:18 AM
distance = (cam.CoordinateFrame.player.Character.Head.Position).magnitude
Don't think this is right cause its not working...( This isn't the full script. )
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 04:33 AM
Here is the full script idk whats wrong and no output. (Yes it's in a localscript.)


local player = game.Players:GetPlayerFromCharacter(script.Parent)

while ((player.Character) and (player.Character:findFirstChild("Head"))) do
local cam = game.Workspace.CurrentCamera
local distance = (cam.CoordinateFrame.player.Character.Head.Position).magnitude
wait(0.25)
if distance > 50 then
distance = 45
end end
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 05:11 AM
Can someone help?...
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 05:24 AM
Why will no one help?
Report Abuse
Truste135 is not online. Truste135
Joined: 26 Oct 2010
Total Posts: 741
02 Feb 2014 05:39 AM
because i dont know flying cows about camera

i'm not crazy just ask my toaster
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 05:39 AM
Well can someone help or is everyone on at the moment dumbfounded?
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 05:46 AM
I NEED HELP Y I NO GET HALP :[
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
02 Feb 2014 05:52 AM
Whilst I don't know much, if anything, about how the Camera works, the reason it's not doing anything visible is due to the fact you're simply changing a variable. Which of course isn't visible to the player.
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:00 AM
Sooo umm How would i do this...?
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Feb 2014 06:02 AM
LocalScript?
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:09 AM
*Here is the full script idk whats wrong and no output. (Yes it's in a localscript.)*

Read the first line where i posted the script. :l
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:12 AM
CAN SOMEONE ANYONE PLEASE HALP ME... :c
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Feb 2014 06:12 AM
local player = game.Players:GetPlayerFromCharacter(script.Parent)

...?

Why not LocalPlayer instead?
And will script.Parent not be Backpack or PlayerGui
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:21 AM
Script is in player >_>
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:23 AM
But yea i have also tried putting LocalPlayer and sticking in the playergui... :/
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Feb 2014 06:24 AM
print("1")
local player = game.Players:GetPlayerFromCharacter(script.Parent)
print("2")
while ((player.Character) and (player.Character:findFirstChild("Head"))) do
print("3")
local cam = game.Workspace.CurrentCamera
print("4")
local distance = (cam.CoordinateFrame.player.Character.Head.Position).magnitude
print("5")
wait(0.25)
print("6")
if distance > 50 then
print("7")
distance = 45
print("8")
end end
print("9")


To which button did the number go?
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:31 AM
2, Player a nil value
then changed it do
local player = game.Players.LocalPlayer
and it said: player is not a valid member
(4)
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:36 AM
print("1")
local p = game.Players.LocalPlayer
print("2")
while ((p.Character) and (p.Character:findFirstChild("Head"))) do
print("3")
local cam = game.Workspace.CurrentCamera
print("4")
local distance = (cam.CoordinateFrame.p.Character.Head.Position).magnitude
print("5")
wait(0.25)
print("6")
if distance > 50 then
print("7")
distance = 45
print("8")
end end
print("9")

Output:

1
2
3
4
- Character is not a valid member
- Script, Line 8
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:53 AM
local p = game.Players.LocalPlayer

while ((p.Character) and (p.Character:findFirstChild("Head"))) do
local cam = game.Workspace.CurrentCamera
local distance = (cam.CoordinateFrame.p.Character.Head.Position).magnitude-- Dis line no workie
wait(0.25)
if distance > 50 then
distance = 45
end end
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 06:56 AM
HALP please idk what i need to do to it... :/
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 07:01 AM
Help me please. :/
Help me please. :/
Help me please. :/
Help me please. :/
Help me please. :/
:(
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
02 Feb 2014 07:04 AM
Considering that you don't want to screw the camera up, and that the 'Zoom' method of the Camera is either locked/not working, the best you would potentially be able to do is by adding a GUI which isn't transparent, and then make it visible when they have zoomed further than you want.

You do not need to bump your thread every two seconds.
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
02 Feb 2014 07:06 AM
nuu gui is noobish and i know it can be done.
I have seen it used in games. :L
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