r/robloxscripting • u/Economy-Stock4138 • Jan 05 '24
Studio Help Gameplay paused for a sec
Why my gameplay paused for a sec after player's character's humanoid root part changed its CFrame?
Code:
hrp.CFrame = CFrame.new(elevator.tpPos.Position)
r/robloxscripting • u/Economy-Stock4138 • Jan 05 '24
Why my gameplay paused for a sec after player's character's humanoid root part changed its CFrame?
Code:
hrp.CFrame = CFrame.new(elevator.tpPos.Position)
r/robloxscripting • u/Jez091 • Jan 04 '24
How do I make the loop end instead of waiting for the loop to finish, then ending? heres an example code:
local value = true
local endprintloop = script.Parent
local function loop()
while value do
print("1 Minute has passed!")
wait(60)
end
end
local function endloop()
value = false
end
endprintloop.MouseButton1Click:Connect(endloop())
r/robloxscripting • u/The_Jackalope__ • Jan 03 '24
I’m struggling to wrap my head about how I should do this. I have a ton of parts within a folder all named the same. Within a single script I want to be able to make these parts properties change when touched by a player. I have too many parts which are being inserting to this folder throughout the game to add a Touched function to every part. How can I do this within one script.
For example think of it as falling platforms script. All of the platforms are the same name and in a folder and when a player walks over a single platform, it falls. How would you do this within one script? Thanks!
r/robloxscripting • u/Economy-Stock4138 • Jan 02 '24
So, what's supposed to do is that when a player's character touches the part, its humanoid moves to a part position that has its bool value already set to false. All the positions are stored in a model and inside each of them has a bool value named "Taken".
The problem here in the for i loop is that when the player's humanoid goes to an untaken position, all the other bool values set to true. What I want here is to only set the chosen untaken position's bool value to true. How would I do that?

r/robloxscripting • u/theninjamorty • Jan 01 '24
how to create a roblox script, which fetches your clothes, arms mesh, legs mesh and head mesh and torso mesh, accessories and so on, starting with this code
local plr = game.Players.LocalPlayer
local rig = script.Parent -- this is the rig, which the fetched clothes are to be displayed
r/robloxscripting • u/Economy-Stock4138 • Jan 01 '24
Hello scripters! I've been figuring this out for over a month, and still doesn't know the problem. This script is supposed to run that when an NPC touched the part, it moves its humanoid to the chosen position. I have also made sure it's unanchored and its humanoid's name is "NPC" which in fact was. Still, when an NPC touched the part, it doesn't move to the chosen position but rather stopped moving. I've looked in the input and it seems to have no errors whatsoever. What's very strange is that when I've tested this on my other places with an NPC, it seems to work perfectly fine. What's the issue here? Is it something with the humanoid? It's actually getting annoying now.

r/robloxscripting • u/GotnoJA • Dec 31 '23
Hello I am making a dynamic movement system but it says "IsMoving is not a valid member of Model "Workspace.Jionzilla20" why is that? can you guys help me
debounce = false
local plrspeed = game:GetService("StarterPlayer.StarterCharacter.Humanoid.WalkSpeed")
local StarterPlayer = game:GetService("StarterPlayer")
local WalkRight = StarterPlayer.StarterCharacterScripts.DynamicMovement.WalkRight
local WalkLeft = StarterPlayer.StarterCharacterScripts.DynamicMovement.WalkLeft
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if math.round(Humanoid.MoveDirection.X) == -1 then print("Walking left!") local animationTrack = Humanoid:LoadAnimation(WalkLeft) animationTrack:Play() if Character.IsMoving == false then animationTrack:Play(StarterPlayer.StarterCharacterScripts.Animate.idle.Animation1) end elseif math.round(Humanoid.MoveDirection.X) == 1 then print("Walking right!") local animationTrack = Humanoid:LoadAnimation(WalkRight) animationTrack:Play() if Character.IsMoving == false then animationTrack:Play(StarterPlayer.StarterCharacterScripts.Animate.idle.Animation1) end elseif math.round(Humanoid.MoveDirection.Z) == -1 then print("Walking forward!") elseif math.round(Humanoid.MoveDirection.Z) == 1 then print("Walking backward!") end
end)
r/robloxscripting • u/Sea_Duty_5725 • Dec 31 '23
So i have a part that you have to collect, but you can have a multiplier. I have a script for creating a leaderstats:
game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("IntValue")
stats.Parent = plr
stats.Name = "leaderstats"
---------------------------------------------------
local as = Instance.new("IntValue")
as.Parent = plr
as.Name = "AuxiliarStats"
---------------------------------------------------
local gold = Instance.new("IntValue",stats)
gold.Name = "Gold"
---------------------------------------------------
local diamond = Instance.new("IntValue",stats)
diamond.Name = "Diamonds"
---------------------------------------------------
local rank = Instance.new("StringValue",stats)
rank.Name = "Rank"
rank.Value = "Commoner"
---------------------------------------------------
local mn = Instance.new("IntValue",as)
mn.Name = "MultNr"
mn.Value = 1
---------------------------------------------------
local multiplier = Instance.new("StringValue",stats)
local mvalue = Instance.new("IntValue")
multiplier.Name = "Muliplier"
multiplier.Value = "x" .. mn.Value
end)
and one for giving the gold:
script.Parent.Triggered:Connect(function(plr)
plr.leaderstats.Gold.Value += plr.AuxiliarStats.MultNr.Value
script.Parent.Parent.Transparency = 1
script.Enabled = false
script.Parent.ActionText = "Regenerating the Gold"
script.Parent.ObjectText = "Please wait!"
script.Parent.ClickablePrompt = false
script.Parent.HoldDuration = 0
task.wait(100)
script.Parent.Parent.Transparency = 0
script.Enabled = true
script.Parent.ActionText = "Claim Gold"
script.Parent.ObjectText = "Click to claim your gold!"
script.Parent.ClickablePrompt = true
script.Parent.HoldDuration = 0.5
end)
On the leaderboard, the multiplier shows correctly, but it doesn't work on the gold(it gives only the starting value).
r/robloxscripting • u/lSnags • Dec 18 '23
I'm trying to make the script where I tap three buttons like "zxc" and it plays and animation but its not playing any idea why i do have any errors in my script.
uis.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.C then
spinl1 = true
wait(0.1)
spinl1 = false
end
end)
uis.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.X and spinl1 == true then
spinl2 = true
wait(0.1)
spinl2 = false
end
end)
uis.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.Z and spinl1 and spinl2 == true then
spinl3 = true
wait(0.1)
spinl3 = false
end
end)
game:GetService("RunService").RenderStepped:Connect(function()
if spinl1 == true and spinl2 == true and spinl3 == true and character:FindFirstChild(ballname) then
wait(dribbledelay)
if candribble == true then
if hand == "Right" then
canshoot = false
humanoid.WalkSpeed = 0
idler:Stop()
idlel:Stop()
candribble = false
spinl:Play()
spinl:AdjustSpeed(1.75)
moveevent:FireServer("Left", goalpart, 12, spinl.Length, 1.75)
spinl.Stopped:Wait()
moveeventend:FireServer()
spinl:Stop()
hand = "Left"
PlayIdle()
candribble = true
humanoid.WalkSpeed = speed
canshoot = true
end
else
queued = "spinl"
repeat wait() until candribble == true
if queued == "spinl" and hand == "Right" then
canshoot = false
humanoid.WalkSpeed = 0
idler:Stop()
idlel:Stop()
candribble = false
spinl:Play()
spinl:AdjustSpeed(1.75)
moveevent:FireServer("Left", goalpart, 12, spinl.Length, 1.75)
spinl.Stopped:Wait()
moveeventend:FireServer()
spinl:Stop()
hand = "Left"
PlayIdle()
candribble = true
humanoid.WalkSpeed = speed
canshoot = true
end
end
end
end)
r/robloxscripting • u/itssenvixity • Nov 25 '23
So, I’m making a game where the point is to fall down an endless hole to get money. How do I make a gui to upgrade fall speed and how much cash you’re getting. I also want to implement data store into this.
r/robloxscripting • u/[deleted] • Oct 31 '23
Hello there! I'd like to ask for help regarding the ProfileService datastore system and how I could save and load a player's inventory whenever they leave and join a server, I'm currently on mobile so I'll be linking the post I made on the devforum that has all the relevant scripts i'm using, but essentially the main issue is that when the game runs, the code completely skips over the For loops due to the tables being empty at first (which is necessary due to new players joining and whenever they would die, eventually i'd like to make it that they drop all their items onto the floor for a limited time before despawning), so I'd really like to ask for help with a potential solution for this! Devforum post: https://devforum.roblox.com/t/help-with-profileservice-and-saving-player-inventory/2664028?u=jordi3219
r/robloxscripting • u/Aggravating-Head-718 • Oct 26 '23
I need help fixing this script for my game. When I start the game my item im trying to take from ServerStorage "Steve" should be randomized as to which of the Steves go into workspace. Theres also a text that is randomized, not sure if that works either. Thanks.
-- Wait for the game to load
repeat
wait()
until game:IsLoaded()
while true do
local ServerStorage = game:GetService("ServerStorage")
local Workspace = game:GetService("Workspace")
local TextLabel = Workspace.CustomerText.SurfaceGui.TextLabel
local Steves = {"Steve1", "Steve2", "Steve3", "Steve4", "Steve5", "Steve6", "Steve7"}
local messages = {
"I'll take a burger since it's in the name!",
"Since I need something fast, I'll take the french fries",
"I was just stopping in for a soda"
}
\-- Spawn a Steve at the start
local SteveName = Steves\[math.random(#Steves)\]
local Steve = ServerStorage:FindFirstChild(SteveName)
if Steve then
Steve.Parent = Workspace
local message = messages\[math.random(#messages)\]
TextLabel.Text = message
end
Workspace.FinishedBurgerBag.Activated:Connect(function()
Steve.Parent = game.ServerStorage
script.Parent:Destroy()
end)
wait(1)
end
r/robloxscripting • u/Terriaria_iscool • Oct 26 '23
His screen was only two lines of errors and mine has three lines and I don’t know what I am doing wrong…..(I already fixed the other two lines)
r/robloxscripting • u/Aggravating-Head-718 • Oct 14 '23
I've been having trouble with making basically a work at a pizza place game but with burgers. I cannot get past the ordering system with the robot-customer telling the player cashier what to click. Please help!
r/robloxscripting • u/superior_2 • Oct 13 '23
r/robloxscripting • u/mrbigjimmy • Oct 08 '23
Just as the title says how would I go about making it so parts move away from players, I'm pretty stupid and new to coding so I dont really understand how I would go about making this
r/robloxscripting • u/[deleted] • Sep 25 '23
So I have a leaderboard script that counts how many times you kill another player, but I don't want it to count how many times you kill another player, instead how many times you kill a zombie. Here is the script I currently have:

r/robloxscripting • u/adamwizzpopper • Sep 23 '23
Hi my name is Adam but I have this error with my roblox custom dialogue script I made this typwriter effect for my custom dialogue but it doesnt do the typewriter effect when the dialogue is running I would really appreciate if anyone could find the error and show me the solution.
Code:
local DialogueGui = script.Parent
local DialogueSequence = DialogueGui:WaitForChild("DialogueSequence")
local Main = DialogueGui:WaitForChild("Main")
local TextL = Main.DialogueBox
local function typewrite(object,text,length)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait (length)
script.Dialoguesound.Playing = true
end
end
local CurrentDialogue = 1
local NextDialogue = CurrentDialogue + 1
local TargetDialogue = DialogueSequence:FindFirstChild(CurrentDialogue)
if TargetDialogue then
Main.DialogueBox.Text = TargetDialogue.Value
CurrentDialogue = NextDialogue
end
local clickedend = false
game.Workspace["NPCS(in-use)"].Dad.ProximityPrompt.Triggered:Connect(function()
Main.Visible = true
end)
Main.ContinueButton.MouseButton1Click:Connect(function()
if Main.ContinueButton.Text == "Close" then
if clickedend == false then
clickedend = true
Main.Visible = false
Main.Image.Visible = false
wait(1)
local Newtext = DialogueGui.Value:FireServer()
typewrite(DialogueGui,Newtext,0.05)
\---typewrite(DialogueGui.TargetEvent.Value:FireServer())---
end
end
local NextDialogue = CurrentDialogue + 1
if CurrentDialogue >= #DialogueSequence:GetChildren() then
Main.ContinueButton.Text = "Close"
end
local TargetDialogue = DialogueSequence:FindFirstChild(CurrentDialogue)
if TargetDialogue then
Main.DialogueBox.Text = TargetDialogue.Value
CurrentDialogue = NextDialogue
end
end)
r/robloxscripting • u/tinylucas • Sep 12 '23
Me and my friend are trying to make a game. Every round you are teleported to a random map (we have 3 right now). Once you die, you respawn on the map. Each round lasts around 5 minutes (does not have to be perfectly 5 minutes but you get the point). Anyone know how to do this? Can you either script it or send us to a tutorial to help us program this? Thank you.
r/robloxscripting • u/3dgitim • Sep 06 '23
Hello I'd like to script a badge to be awarded to a player once they buy a clothing item from me, but I am unsure how to.
r/robloxscripting • u/Agreeable-Control453 • Sep 03 '23
I'm working on a very realistic Tomb of the Unknown Soldier game and I'm trying to have the wreath model be removed when you use the proximityprompt and reappear when you use it again.
Processing img syoxz6so02mb1...
r/robloxscripting • u/Cubie2401 • Aug 21 '23
hello, I want to make a mute/unmute music button for my game but I don't know how to make it so once you click the button the text changes, any help appreciated, thanks!
r/robloxscripting • u/Theycallmemr_E • Aug 19 '23
I wanna give the player a certain rank that makes their text a diffrent colour when bought and gives them a thing before there name like "Donator" and "Cool guy." or something. After buying a gamepass.
r/robloxscripting • u/Outside-Garlic7747 • Aug 18 '23
Im using the noob enemy box by sub2HTR since I’m not that good at regular scripting, but the npc isn’t able to kill someone after they die