Tickmark
|
  |
| Joined: 26 Jan 2014 |
| Total Posts: 560 |
|
|
| 25 Jun 2015 04:51 PM |
game.Workspace.Part.touched:connected(function() game.Workspace.Camera.FieldOfView = 1 end)
- |
|
|
| Report Abuse |
|
|
| |
|
Dynerov
|
  |
| Joined: 21 Jul 2014 |
| Total Posts: 14682 |
|
|
| 25 Jun 2015 04:52 PM |
| Is this in a local script? |
|
|
| Report Abuse |
|
|
Tickmark
|
  |
| Joined: 26 Jan 2014 |
| Total Posts: 560 |
|
| |
|
|
| 25 Jun 2015 04:54 PM |
.Touched and :connect()
like:
part.Touched:connect(function()
end) |
|
|
| Report Abuse |
|
|
Dynerov
|
  |
| Joined: 21 Jul 2014 |
| Total Posts: 14682 |
|
|
| 25 Jun 2015 04:55 PM |
Well, you cannot change the Workspace's Camera.
You can change the CurrentCamera through a LocalScript, which would change your camera. |
|
|
| Report Abuse |
|
|
Tickmark
|
  |
| Joined: 26 Jan 2014 |
| Total Posts: 560 |
|
| |
|
seliso
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 6443 |
|
|
| 25 Jun 2015 04:56 PM |
is it in a local script?
you can only change someone's camera via local unless you use remoteevents so like
part.Touched:connect(function(obj) local player = game.Players:GetPlayerFromCharacter(obj.Parent) if player then event:FireClient(player,"CameraChange") end end) |
|
|
| Report Abuse |
|
|
Tickmark
|
  |
| Joined: 26 Jan 2014 |
| Total Posts: 560 |
|
| |
|
|
| 25 Jun 2015 05:01 PM |
Server-Script in ServerScriptService:
local event = Instance.new("RemoteEvent", game.ReplicatedStorage) event.Name = "event"
workspace.part.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then event:FireClient(player,"CameraChange") end end)
LocalScript in StarterGui.
local event = game.ReplicatedStorage:WaitForChild("event")
event.OnClientEvent:connect(function(argument) if argument == "CameraChange" then workspace.CurrentCamera.FieldOfView = 1 end end)
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2015 05:02 PM |
Make sure there aren't any more parts named "Part" Make sure this is in a LocalScript
game.Workspace.Part.Touched:connect(function() game.Workspace.CurrentCamera.FieldOfView = 1 end)
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2015 05:03 PM |
^
That would make ALL clients get the same effect.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2015 05:03 PM |
@power why do that when you could just do it a short and simple way |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jun 2015 05:14 PM |
^
Test it then. When I tested it, whenever that part got touched, by another player, I had the same effects.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784
|
|
|
| Report Abuse |
|
|