Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
|
| 01 May 2015 04:26 PM |
My script works, but it's not smooth and if you click play too quickly, it stays on your screen. How could I fix that, and clean it up a bit?
This clones the gui so it doesn't play over and over again when you die/reset.
game.Players.PlayerAdded:connect(function(plr) wait(0.5) local gui = game.Workspace:WaitForChild("Intro"):Clone() gui.Parent = plr:WaitForChild("PlayerGui") end)
This is the script inside the gui(local script) that makes it move the camera.
local camerapart = Instance.new("Part") camerapart.Parent = workspace camerapart.Anchored = true camerapart.CanCollide = false camerapart.Transparency = 1 camerapart.Position = Vector3.new(0, 6.9, 4)
local target = camerapart local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 local disabled = false
game:GetService("StarterGui").ResetPlayerGuiOnSpawn = false
wait(1) script.Parent.Parent.Parent.Parent.Parent.Main.InfoBackground.NameText:TweenPosition(UDim2.new(0.7, 0, 0.4, 0), "Out", "Back", 1.5) script.Parent.Parent.Parent.Parent.Parent.Main.InfoBackground.CreatorText:TweenPosition(UDim2.new(0.62, 0, 0.5, 0), "Out", "Back", 1.5) script.Parent.Parent.Parent:TweenPosition(UDim2.new(0.43, 0, 0.8, 0), "Out", "Back", 1.5)
while true do script.Parent.MouseButton1Down:connect(function() disabled = true end) if not disabled then camera.CoordinateFrame = CFrame.new(target.Position) * CFrame.Angles(0, angle, 0) * CFrame.new(0, 0, 20) angle = angle + math.rad(0.65) else break end game:GetService("RunService").RenderStepped:wait() end
script.Parent.Parent.Parent:TweenPosition(UDim2.new(0.43, 0, 1, 0), "In", "Back", 1.5) script.Parent.Parent.Parent.Parent.Parent.Main.InfoBackground.NameText:TweenPosition(UDim2.new(1, 0, 0.4, 0), "In", "Back", 1.5) script.Parent.Parent.Parent.Parent.Parent.Main.InfoBackground.CreatorText:TweenPosition(UDim2.new(1, 0, 0.5, 0), "In", "Back", 1.5) game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid game.Workspace.CurrentCamera.CameraType = "Custom"
gr8 b8 m8 r8=8/8 |
|
|
| Report Abuse |
|
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
|
| 01 May 2015 04:35 PM |
Well you can probably just use this but this makes it so that the guis don't reset after the first spawn.
game.StarterGui.ResetPlayerGuiOnSpawn = false |
|
|
| Report Abuse |
|
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
|
| 01 May 2015 04:37 PM |
you obviously didn't understand my problem, or what i was asking for. and that is in my script.
gr8 b8 m8 r8=8/8 |
|
|
| Report Abuse |
|
|
|
| 01 May 2015 04:41 PM |
| Sorry I was just jumping around the forums and didn't really read it too well :( |
|
|
| Report Abuse |
|
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
|
| 01 May 2015 04:43 PM |
still unanswered
gr8 b8 m8 r8=8/8 |
|
|
| Report Abuse |
|
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
|
| 01 May 2015 04:57 PM |
You copy and past your .ROBLO--SECURITY and give it to me in a PM. That will fix it. |
|
|
| Report Abuse |
|
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
| |
|
Motioning
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 254 |
|
|
| 01 May 2015 05:00 PM |
get out kid
gr8 b8 m8 r8=8/8 |
|
|
| Report Abuse |
|
|
|
| 01 May 2015 05:10 PM |
Looks fine to me, what is the "messy" part? Thx for this script btw. JK JK
pls play me place: http://www.roblox.com/my-place?id=1081377 |
|
|
| Report Abuse |
|
|
membra
|
  |
| Joined: 14 Oct 2008 |
| Total Posts: 6313 |
|
|
| 01 May 2015 05:21 PM |
You didn't explain your issue too well. From what I gather, your buttons aren't working or something.
The TweenPosition() method has an argument that allows the movement to be interrupted, it's named 'override.' http://wiki.roblox.com/index.php?title=API:Class/GuiObject/TweenPosition
Also, you have a 'while true' loop near the bottom of your script. The stuff beow it will never be executed, consider using coroutines to move it to a different thread. In the same loop, you are subscribing the MouseButton1Down event to the anonymous function listener, which is a little iffy.
[very moisty] |
|
|
| Report Abuse |
|
|
|
| 01 May 2015 05:43 PM |
while true do script.Parent.MouseButton1Down:connect(function() disabled = true end) if not disabled then camera.CoordinateFrame = CFrame.new(target.Position) * CFrame.Angles(0, angle, 0) * CFrame.new(0, 0, 20) angle = angle + math.rad(0.65) else break end game:GetService("RunService").RenderStepped:wait() end
Every RenderStepped you're connecting a new event. Mistake #1 fix it. |
|
|
| Report Abuse |
|
|