ElCalz
|
  |
| Joined: 12 Sep 2016 |
| Total Posts: 1 |
|
|
| 11 Jul 2017 05:57 PM |
Hello, I recently started trying to make a game to play with my friends. It is a fairly simple game but if Im going to do it I want to do it right. I added a shift to sprint script and I need to refrain the player from moving because when the player moves during the intermission and the intermission ends and he goes back to spawn, the shift will just make the player run normal and if you let go of the shift well then the walkspeed is 0. As I said earlier I don't know much so I will leave the sprinting script at the end so if someone can check if the problem is there. If someone knows how to fix this please give me your advice.
Script: (I did not make this script)
game:GetService("UserInputService").InputBegan:connect(function(input,gameprocesed) if input.KeyCode == Enum.KeyCode.LeftShift then for i = 1,16 do wait() game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView + 1.6 game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed + 1 end end end)
game:GetService("UserInputService").InputEnded:connect(function(input,gameprocesed) if input.KeyCode == Enum.KeyCode.LeftShift then for i = 1,16 do wait() game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView - 1.6 game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed - 1 end end end)
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:connect(function() game.Workspace.Camera.FieldOfView = 70 game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 script.Disabled = true end) |
|
|
| Report Abuse |
|
|
somebeal
|
  |
| Joined: 24 Nov 2016 |
| Total Posts: 56 |
|
|
| 12 Jul 2017 11:35 AM |
why dont u just make the torso of the player anchored until the intermission finishes?
|
|
|
| Report Abuse |
|
|
lawahh19
|
  |
| Joined: 22 Dec 2014 |
| Total Posts: 235 |
|
|
| 12 Jul 2017 12:06 PM |
| or change humanois properties like walkspeed |
|
|
| Report Abuse |
|
|
LeafDoode
|
  |
| Joined: 29 May 2017 |
| Total Posts: 3094 |
|
|
| 12 Jul 2017 12:47 PM |
function Intermission() for Time = 20,1,-1 do print(Time) wait(1) for Number,Player in pairs(game.Players:GetPlayers()) do if Player and Player.Character then local Humanoid = Player.Character:WaitForChild("Humanoid") if Humanoid and Humanoid.Health > 0 then Humanoid.WalkSpeed = 0 end end end end end
Intermission() |
|
|
| Report Abuse |
|
|