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 » Scripters
Home Search
 

Re: Prevent Player From Moving During Game Intermission

Previous Thread :: Next Thread 
ElCalz is not online. 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 is not online. 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 is not online. lawahh19
Joined: 22 Dec 2014
Total Posts: 235
12 Jul 2017 12:06 PM
or change humanois properties like walkspeed
Report Abuse
LeafDoode is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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