|
| 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 |
|
|
|
| 02 Feb 2014 04:05 AM |
| Wiki link or anything will help i'm not sure what to search. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|
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 |
|
|
|
| 02 Feb 2014 05:39 AM |
| Well can someone help or is everyone on at the moment dumbfounded? |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2014 05:46 AM |
| I NEED HELP Y I NO GET HALP :[ |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 02 Feb 2014 06:00 AM |
| Sooo umm How would i do this...? |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
|
| 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 |
|
|
|
| 02 Feb 2014 06:12 AM |
| CAN SOMEONE ANYONE PLEASE HALP ME... :c |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 02 Feb 2014 06:23 AM |
| But yea i have also tried putting LocalPlayer and sticking in the playergui... :/ |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 02 Feb 2014 06:56 AM |
| HALP please idk what i need to do to it... :/ |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2014 07:01 AM |
Help me please. :/ Help me please. :/ Help me please. :/ Help me please. :/ Help me please. :/ :( |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|