Hello everyone! I hope you enjoyed this video! I released a Patreon for those that want to support me (with lots of benefits including scripting support!) www.patreon.com/PremiumScripters
I'm trying to make it freeze because the starting animation for the game and cutscene, the player is still able to move in. but the catch is the spawn on the island has a part and once the player touches the part it'll play the animation but i need to freeze it so it doesnt just start
The video teaches you how to freeze the player so they don’t move. You can incorporate it into your game by placing the line(s) of code wherever you want it to freeze
@@scripting okay thanks i got it, but i am trying to make it freeze for 15 seconds before unfreezing so i put wait(15) before the line that unfreezes but its always unfreezing at 5 seconds... idk why that is. Can u help possibly?
You can also disable the controls from the PlayerModule in PlayerScripts like this: local Player = game:GetService("Players").LocalPlayer local PlayerModule = require(Player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls() PlayerModule:Disable()
get a table of the players in the team, make a for loop which goes through each player and anchors their humrp or whichever method of freezing you prefer.
@Syher_BloxFruits my recommendation is that you watch through this playlist Beginner's Guide to Roblox Scripting Tutorials ua-cam.com/play/PL8fZVwiyGscD354QCCczm1D5v0hCnA8-r.html It will give you a basic coding foundation. If your button is inside of a ScreenGui inside of StarterGui, you can do something like this: game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton.MouseButton1Click:Connect(function() game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true end)
@Mr.Sfoozs Hi! The “for i, player in pairs” loops through every player. The “player” refers to the current player that it’s on during the loop. So let’s say player1 and player2 were in the game. The loop will cycle through both players and the variable “player” will refer to the current player that it’s on. So the first time, “player” refers to player1, and the second time it refers to “player2”
So, I have a game when player goes through part a jumpscare will appear, and i need the player to stop moving and camera to freeze at certain position. I tried to freeze player by your script but it isnt working. What should I do? Please help
@@scripting I tried puttung the code together with my "on touch" code, but it doesnt wotk. It looks like this: local player = game.Players.LocalPlayer local char = player.Character local hrp = char.HumanoidRootPart local FreezePart = script.Parent local function onPartTouched(otherPart) local partParent = otherPart.Parent local humanoid = partParent:FindFirstChild("Humanoid") if humanoid then hrp.Anchored = true end end FreezePart.Touched:Connect(onPartTouched) Please help. Again...
@@scripting local player = game.Players.LocalPlayer local char = player.Character local hrp = char.HumanoidRootPart local storage = game.ReplicatedStorage hrp.Anchored = true
Basically how do I make it where like the player freezes for a certain duration, unfreezes after a certain duration and has a cooldown when the part can be touched again?
Hi! You can use the task.wait function to achieve this. So, freeze the player. task.wait(2) Unfreeze the player The task.wait(2) waits 2 seconds. To implement a cooldown, you’ll need to learn about Boolean variables. Check my variables tutorial on that. You’ll also need if statements (something called denounce).
Hello everyone! I hope you enjoyed this video! I released a Patreon for those that want to support me (with lots of benefits including scripting support!)
www.patreon.com/PremiumScripters
the lofi still with you is nice
The ContextActionService way only freezes controls on pc, not on mobile or console.
Ah, sorry about that. Use the other 2
Hey, How do you make your character pause for a second by using a letter such as "E"?
I'm looking to make the script activate when a part is touched,and deactivate it when the part isn't touched anymore.
what ever happened to your brick bronze game and discord server
I'm trying to make it freeze because the starting animation for the game and cutscene, the player is still able to move in. but the catch is the spawn on the island has a part and once the player touches the part it'll play the animation but i need to freeze it so it doesnt just start
The video teaches you how to freeze the player so they don’t move. You can incorporate it into your game by placing the line(s) of code wherever you want it to freeze
@@scripting okay thanks i got it, but i am trying to make it freeze for 15 seconds before unfreezing so i put wait(15) before the line that unfreezes but its always unfreezing at 5 seconds... idk why that is. Can u help possibly?
Check the output for errors@@IgoByHood
Thanks a lot!!!
How do I make it so that if I hold E on a block it stop my character completely?
Here's the code from #3:
local ContextActionService = game:GetService('ContextActionService')
ContextActionService:BindAction(
"FreezeMovement",
function() return Enum.ContextActionResult.Sink end,
false,
unpack(Enum.PlayerActions:GetEnumItems())
)
You can also disable the controls from the PlayerModule in PlayerScripts like this:
local Player = game:GetService("Players").LocalPlayer
local PlayerModule = require(Player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls()
PlayerModule:Disable()
@ate9d absolutely correct. It was not covered in this video but is correct nevertheless- thank you!
how i can freeze a npc like my avatar bc its keep falling
how do you make it so you can freeze a certain team?
get a table of the players in the team, make a for loop which goes through each player and anchors their humrp or whichever method of freezing you prefer.
Hi, love your vids but quick question!
How do you unfreeze the player if you used the last script?
copy and paste, but instead of walkspeed = 0 do it at 16 or whatever speed u want
ive leared scripting over the last month and thats not how you do it
@@nomadrblx8659
@@nomadrblx8659 no i mean the LAST script with the binding and allat
@@Ignition823 i believe you need to change false to true
so i have a gui for my game that says play and that has a script so how do i add it in without breaking the original script?
You can just put the code from this video wherever you want the player to be frozen
I want to code it so that when I press play it disables the freeze
@@scripting ?
@Syher_BloxFruits my recommendation is that you watch through this playlist
Beginner's Guide to Roblox Scripting Tutorials
ua-cam.com/play/PL8fZVwiyGscD354QCCczm1D5v0hCnA8-r.html
It will give you a basic coding foundation.
If your button is inside of a ScreenGui inside of StarterGui, you can do something like this:
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextButton.MouseButton1Click:Connect(function()
game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true
end)
How do i do this if i click a part?
You’d have to bind it to a ClickDetector
How do i make it so every player freezes
You can use
for i, player in pairs(game.Players:GetPlayers() do
- - put the freeze code here
end
@@scripting thanks bro
what does the for i,player in pairs do?@@scripting
@Mr.Sfoozs Hi! The “for i, player in pairs” loops through every player. The “player” refers to the current player that it’s on during the loop.
So let’s say player1 and player2 were in the game. The loop will cycle through both players and the variable “player” will refer to the current player that it’s on. So the first time, “player” refers to player1, and the second time it refers to “player2”
Can u pls make a vid how to stop a killer(from toolbox) stop moving if u look at it
So, I have a game when player goes through part a jumpscare will appear, and i need the player to stop moving and camera to freeze at certain position. I tried to freeze player by your script but it isnt working. What should I do? Please help
The code from this video should work. Try using the humanoid root part . Anchored = true
@@scripting I tried puttung the code together with my "on touch" code, but it doesnt wotk. It looks like this:
local player = game.Players.LocalPlayer
local char = player.Character
local hrp = char.HumanoidRootPart
local FreezePart = script.Parent
local function onPartTouched(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChild("Humanoid")
if humanoid then
hrp.Anchored = true
end
end
FreezePart.Touched:Connect(onPartTouched)
Please help. Again...
@Matetheemperorofhell you want your hrp to be right after that “if humanoid” line
You want local hrp = partParent.HumanoidRootPart
it does not work
It should
@@scripting i dont find humanoid root part
and it says attempet to index nil with Character
Can I see your code?
@@scripting local player = game.Players.LocalPlayer
local char = player.Character
local hrp = char.HumanoidRootPart
local storage = game.ReplicatedStorage
hrp.Anchored = true
Basically how do I make it where like the player freezes for a certain duration, unfreezes after a certain duration and has a cooldown when the part can be touched again?
Hi! You can use the task.wait function to achieve this.
So, freeze the player.
task.wait(2)
Unfreeze the player
The task.wait(2) waits 2 seconds.
To implement a cooldown, you’ll need to learn about Boolean variables. Check my variables tutorial on that. You’ll also need if statements (something called denounce).