question_score stringclasses 21
values | title stringlengths 6 119 | question_userid stringlengths 4 10 | question_user stringlengths 3 20 | question_user_score stringclasses 496
values | question_datetime stringdate 2014-02-01 23:57:31 2023-04-02 01:40:15 | question stringlengths 0 11k | question_id stringlengths 1 6 | answer_count stringclasses 8
values | answer_id stringlengths 0 6 | answer_score stringclasses 18
values | answer_userid stringclasses 946
values | answer_user stringclasses 963
values | answer_user_score stringclasses 692
values | answer_datetime stringlengths 0 19 | answer stringlengths 0 10.7k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | IntValue script working for a solo player but when two players are present it breaks ? | 861475515 | kek_productions | 7 | 2022-06-07 12:05:30 | <p>In a solo server it works perfectly as intended, but with 2 players when one of them walks through the door it works until the other player walks through, which gives this error:</p>
<p><a target="_blank" href="http://">https://imgur.com/a/boXU6oE</a></p>
<p>(the puzzle is to walk through a door 5 times locally to w... | 130262 | 1 | 117623 | 0 | 754480402 | sleazel | 1287 | 2022-06-07 13:09:00 | <p>This is a local script. This means each player has its own copy of it. Therefore there is no need to run this function for any other player than local player.</p>
<p>Replace line 16 with this:</p>
<pre class="brush: lua">if PlayerFromCharacter == game.Players.LocalPlayer then
</pre>
<p>Hope this helps.</p>
|
2 | wait() and coroutine.yield()? | 111034902 | MightyQuestionAsker | 297 | 2016-03-06 04:06:59 | <p>I've been reading the wiki, and it says that it's <code>wait</code> function is pretty much based around <code>coroutine.yield</code>. Just wondering, what would this function look like? Could anyone give an example of what it would be like to create an "artificial" wait function with ROBLOX Lua using coroutine.yiel... | 28173 | 2 | 31634 | 1 | 16872215 | einsteinK | 145 | 2016-03-06 10:40:20 | <p>A custom wait function can be made in 2 ways:</p>
<ul>
<li>You turn your thread in a ROBLOX thread (one that's in the internal taskscheduler)</li>
<li>You make your own task scheduler that runs in another thread</li>
</ul>
<p>By default, every thread, except ones created with the coroutine library are ROBLOX threads... |
0 | How to delete a place after you create it? | 11808841 | blowup999 | 647 | 2016-11-26 20:27:35 | <p>I have a universe with 2 places inside it and I send people from the main place to the second place, but first I make a servers with their name.</p>
<pre class='brush: lua'>local newPlaceId = game:GetService("AssetService"):CreatePlaceAsync(name, 556371267);
</pre>
<p>I made a couple of servers for me and a testing ... | 37533 | ||||||||
1 | I have been getting a strange error for two days now, how can I fix it? | 904549919 | exciteddolphin | 9 | 2019-07-31 19:40:10 | <p>"ContentProvider callback exception: SerializerPugi::deserializeImpl ill-formed XML"</p>
<p>Not sure what caused it but this error happens every time I test my game. It makes it so my character doesn't have a walking animation.</p>
| 84826 | ||||||||
0 | Music w/ Text changing Script works offline but not on Robloxplayer? | 35506464 | Alanisme124 | 0 | 2017-10-23 09:11:28 | <p>Hey, I have a problem which when I use this script in online mode, the script (Sound/textlabel) just doesn't work at all. No Output, no sound, nothing.</p>
<p><strong>Script Kind:</strong> Server
<strong>Location:</strong> StarterGui.mynamesjeff(Screengui).Frame.Frame.Textlabel
<strong>Game:</strong> https://www.rob... | 48850 | ||||||||
0 | Help with detecting Character? | 123585026 | NykoVania | 231 | 2022-11-22 07:40:50 | <p>I get 2 errors in output:</p>
<blockquote>
<p>attempt to index nil with Parent - <em>Line 6</em></p>
</blockquote>
<p>and</p>
<blockquote>
<p>Argument 1 missing or nil - <em>Line 12</em></p>
</blockquote>
<p>I have no idea how to troubleshoot these errors and I need assistance with them if possible.</p>
<p><strong>C... | 132341 | 2 | 119528 | 1 | 94006350 | BulletproofVast | 1033 | 2022-11-22 14:00:22 | <p>don't really understand what you're trying to accomplish with your script, but if theres script.Parent.Parent.Parent then it sets up a new connection every time someone joins.</p>
<p>also, you should pick one and do GetPlayerFromCharacter or Humanoid.Parent.Name.</p>
<p>Detecting the character here is unnecessary. I... |
2 | Camera Manipulation and TextButton Help? | 46382260 | SpazzMan502 | 133 | 2015-06-03 19:21:27 | <p>I have two TextButtons, when you hover over one, it changes the camera to a Control point and spins it around.</p>
<p>It works with one Gui button, but if you hover over another one, it glitches out and changes the camera to one or the other rapidly.</p>
<p>Any way how to fix this? I've heard of breaking the loop, b... | 18120 | ||||||||
2 | Can someone please describe how this for loop works? concise title o.O | 1185259628 | ded_srs | 30 | 2020-04-28 19:15:50 | <pre class='brush: lua'>for i, player in pairs(Players:GetPlayers()) do
end
</pre>
<p>I see this a lot in scripts that interact with the players list but I don't know what it means, specifically "I" and "player in pairs"</p>
| 101102 | 3 | 93389 | 7 | 74087102 | Ziffixture | 6785 | 2020-04-28 19:31:08 | <p>A for loop is apart of a family known as control-flow; you can denote a form iteration built from a condition to define how the code will <em>iterate</em> through the instructions n it's scope. Alternatively, we can use iterator functions to define specific flows for specific scenarios.</p>
<p>A common iterator func... |
1 | [ANSWERED] How do you make a Sound keep playing even if you reset? | 407180563 | robloxtitanic584 | 87 | 2021-04-12 21:28:30 | <p>How do you make a Sound keep playing even if you reset? I have a LocalScript for the Sound in StarterGui and the code is:</p>
<pre class="brush: lua"> game.Workspace.Sound:Play()
</pre>
| 122310 | ||||||||
0 | Quest System With Roblox Dialog? | 680620891 | CosmicIsGod | 139 | 2019-09-12 02:52:25 | <pre class="brush: lua">script.Parent.DialogChoiceSelected:connect(function(player, Dialog)
if Dialog.Name == 'Dialog1' then
game.StarterGui.Quests.QuestsText.Text = "Test"
end
end)
</pre>
<p>So I am trying to make a quest system out of normal dialog (This script is the child of my dialog).
I want it to... | 87343 | ||||||||
0 | how to make custom StarterCharacter gamepass? | 429203148 | n_ubo | 29 | 2020-02-18 18:08:18 | <p>There seem to be no solutions to this question,</p>
<p>The problem is that a free player already gets a custom player rig, and what I want is that if the player buys a game pass he gets a modified one. I have got answers earlier that I have to use Humanoid description but this doesn't seem to work at all since its a... | 94796 | 2 | 87543 | 0 | 322220443 | GeneratedScript | 740 | 2020-02-18 19:41:10 | <p>What you would do is have the model prepared in ReplicatedStorage, then after checking if they own the gamepass, set the local player's character to the model. Your best bet is to use a Remote Event/Function, as the localplayer is always passed as the first argument.</p>
<pre class='brush: lua'>local nm = game.Repli... |
0 | How to get Local Player from server script? | 990574115 | masilasi2008 | 10 | 2022-12-03 02:20:07 | <p>This is the only problem holding me off from fixing my game.</p>
<p><code>game.Players.LocalPlayer</code> does not work and it is confusing me. please help</p>
| 132450 | 1 | 119616 | 1 | 1288500822 | Finty_james | 269 | 2022-12-03 03:22:26 | <p>The way you are describing it is not correct.</p>
<p>Let me break it down for you.</p>
<p><code>game.Players.LocalPlayer</code> cannot be accessed on the server, because only the client and access that value. To see more, search for 'Server-Client Model'. It will give you an understanding of how it works.</p>
<p>But... |
3 | What EXACTLY does the length operator do? | 124281858 | DeceptiveCaster | 3043 | 2018-11-29 13:56:33 | <p>Many people have been arguing with me with this kind of code:</p>
<pre class='brush: lua'>print(#{"1", "2", "3"})
</pre>
<p>The output:</p>
<blockquote>
<p>3</p>
</blockquote>
<p>Now, people argue that the octothorpe (#) returns the number of values in a table, and it does. They're correct.</p>
<p>The other day, I m... | 71321 | 1 | 67738 | 2 | 89430243 | Kiriot22 | 3183 | 2018-11-29 16:52:23 | <p>Let me clear it up then</p>
<p>1) Tables</p>
<p>When <code>#</code> is used on a table, it returns the highest numerical index it can find without stumbling upon nil.</p>
<p>For example</p>
<pre class='brush: lua'>local a = {"hello", "world"}
print(#a)
</pre>
<p>will print <code>2</code>, because <code>a[3]</code> i... |
0 | the player can edit the message, and this was not supposed to happen.? | 416059776 | lytew | 99 | 2020-01-22 03:48:38 | <p>hello. So, I created a script that causes a message to appear on the screen when a player touches a cloud. In the cloud there are 7 parts so I activated each one to the function
The problem is that if a player clicks on the message, he can edit it (the text is in a TextBox) I could put it in a textLabel calmly, but ... | 93399 | ||||||||
0 | How can I modify this script so npcs summoned by you can fight for you via tool? | 1961959172 | imnotaguest1121 | 313 | 2022-11-12 15:08:36 | <p>Hello! I want to modify this script so that when you summon NPCS via a tool the said NPCS will fight for you, like the zombie staff</p>
<p>Script:</p>
<pre class='brush: lua'>--Services--
local Players = game:GetService("Players");
local RunService = game:GetService("RunService");
local PathFindingService = game:Get... | 132250 | ||||||||
0 | Object Value not being set? | 106155155 | SamZeKat | 28 | 2022-06-16 04:16:12 | <p>the Vehicle is an object value and I'm trying to set it to the cloned car, but it does not set. Wondering if I should make the value or script in a different location?</p>
<pre class='brush: lua'>script.Parent.ClickDetector.MouseClick:Connect(function(player)
local VehicleCount = player.leaderstats.vehicle.Value... | 130370 | 1 | 117725 | 1 | 295750059 | SuperLittleAdmin | 177 | 2022-06-16 04:27:11 | <p>You need to reference the ObjectValue itself, you can’t change the <code>.Value</code> of it when it is set to be a variable.</p>
<p>If you reference the value, then do <code>local value = ObjectValue.Value</code>, it is “stored” inside the variable, and any changes made to that variable (<code>value = workspace</co... |
1 | Local Script not finding object within its parent? | 76734233 | generalYURASKO | 99 | 2020-12-18 00:05:56 | <p>I'm trying to reference a remote event from a local script, both the script and remote event are stored within the Tool, yet for some reason, I am getting this error " CurrentFuel is not a valid member of Tool "Players.generalYURASKO.Backpack.Lighter" and I don't understand why the script can't find the remote event... | 117315 | 1 | 107513 | 1 | 2007599571 | RedReedBird | 205 | 2020-12-18 00:25:41 | <p>To add on what FrontsoldierYT said, the objects that you are trying to get have yet to load. Using the WaitForChild command will make sure that it gets the object as soon as it has loaded</p>
<pre class='brush: lua'>local player = game.Players.LocalPlayer
local lighter = player.Backpack:WaitForChild("Lighter")
</pre... |
0 | I am a new scripter and I know nothing can you tell me a few things? | 23382561 | ReadyBeep | 0 | 2014-04-13 10:18:39 | <p>I am trying to make this FPS and I am trying to make it for a clan, this FPS lock wont work?</p>
<p>local Game.Players.CameraMode =(FirstPersonLock)</p>
| 1274 | ||||||||
0 | ServerScriptService.Main:87: attempt to index nil with 'Destroy' help? | 858529530 | BearGamesZ | 4 | 2022-01-04 17:59:42 | <p>I have a pet system, and when i try to unequip the pet everything works just fine, the text changes to unequip, but i get an error in the output saying "Main.87 attempt to index nil with 'Destroy'" and it doesnt unequip the pet. I dont know how to fix this pls helppp</p>
<p>game.ReplicatedStorage.Remotes.UnequipPet.... | 128692 | ||||||||
2 | How do i do 3 while true do loops at once? | 15436391 | tkddude2 | 75 | 2014-03-05 01:01:09 | 495 | 3 | 823 | 2 | 4785454 | Everesty | 1006 | 2014-03-05 02:26:07 | <p>As I said earlier, adding another spawn should fix this. I did forget to mention that you had to use the spawn before your final while loop.</p>
<pre class="brush: lua">Spawn(function()
while wait(5) do
print("5seconds") --Prints "5seconds" every 5 seconds and "0.1second" every 0.1 second
e... | |
0 | Add script parts for the controls a aircraft? | 35349037 | kryptonite141 | 0 | 2014-04-26 02:52:13 | <p>Below is a script for an aircraft of mine but what script would you put so that When the key Y is hit, Not only will it go forword and up, when key q is hit, it would go down and if it was moving (if key Y was hit) t would go forword and down, when key e is hit, it would cause the seat( or aircraft) to go up, and if... | 3557 | ||||||||
0 | How GetPlayer() wont get users GetRankInGroup? | 331809274 | TechModel | 118 | 2022-05-20 12:22:59 | <p>How can I make this work? it doesn't work after running is it because the player hasn't loaded? I look on roblox documentation but they don't explain much as how to they get their id? By character or humanoid something...</p>
<pre class='brush: lua'>for i, v in pairs(game.Players:GetPlayers()) do
v:GetRankInGrou... | 130055 | ||||||||
0 | How do you fetch the players name in a script (More context when clicked)? | 169575230 | Diamondstarracer33 | 0 | 2022-06-22 07:24:05 | <p>Im making it so that theres a model in server storage and it has a script inside of it and what im trying to do with that script is that it gets a players name then gets the character then places the model in the players position. Then using another script that when clicked it will clone model and put in in workspac... | 130455 | ||||||||
0 | How do I make the player's Humanoid hide their username above their head? | 34569211 | Luigi7381 | 25 | 2014-05-30 19:33:09 | <p>I have tried so hard to make this happen, but none of my tries have been successful. Can you please help me with this problem?</p>
| 5859 | 1 | 7790 | 0 | 12014954 | Tempestatem | 884 | 2014-05-30 19:34:41 | <p><strong>I think this will work</strong></p>
<pre class='brush: lua'>function onRespawn(character)
character.Humanoid.NameOcclusion = Enum.NameOcclusion.OccludeAll
end
local function onPlayerEntered(newPlayer)
newPlayer.CharacterAdded:connect(onRespawn)
end
game.Players.PlayerAdded:connect(onPlayerEntered)
</pre>
|
0 | How do I fix "...............Attempt to index nil with"...............'"? | 119214283 | HenriVilliers | 0 | 2021-01-11 22:09:24 | <p>Hello, recently I have been trying to script a script that makes certain imagelabels appear whenever the local player's speed is changed.</p>
<p><strong>NOTE:</strong> I am using discord image links because I don't know how to import images in a post..</p>
<p><strong>This is the error I keep getting:</strong>
<a tar... | 118563 | ||||||||
0 | Why doesn't it print, or put the folder into playergui? | 1488957970 | Radiant_Sparkles | 63 | 2021-02-22 22:41:26 | <p>So the script isn't working</p>
<pre class='brush: lua'>local Player = game.Players.LocalPlayer
local jim = game.Workspace["Flamingo UTG"]:Clone()
local plr = game.Players.LocalPlayer
workspace.IntroductionValue:GetPropertyChangedSignal("Value"):Connect(function()
if workspace.IntroductionValue.Value == 1 then
... | 120536 | ||||||||
0 | Leaderstats kills not working? | 1527823663 | kickoff127 | 101 | 2023-01-15 22:04:03 | <p>Can someone please explain to me why the kills are not working on this leaderstats script? Thanks!</p>
<pre class='brush: lua'>local Players = game.Players
local Template = Instance.new 'BoolValue'
Template.Name = 'leaderstats'
Instance.new('IntValue', Template).Name = "Kills"
Instance.new('IntValue', Template).Name... | 132858 | ||||||||
2 | Script debounce does not work properly and instakills the player [?] | 524832183 | nikitos54327 | 70 | 2023-03-11 18:16:28 | <p>Hey scripters!
My script that decreases player's health on touch of an npc doesn't work properly - it insta kills player with no debounce (i scripted it)
Heres the script:</p>
<pre class="brush: lua">local RemoteEvent = game.ReplicatedStorage.RemoteEvents.ActivateJumpscareEvent
local debounce = false
script.Parent.H... | 133179 | 3 | 120251 | 0 | 1792229101 | googlpeopel15 | 55 | 2023-03-11 18:29:24 | <p>I'm pretty sure it's not working because you have it as local debounce instead of globally. Local variables I think go back to their default values when the script is run again. So that's probably your issue here. Try setting the <code>local debounce = false</code> to <code>debounce = false</code></p>
<p>Hope that a... |
0 | Typing into textbox doesnt update text property? | 1080337 | uui | 25 | 2020-09-13 21:36:10 | <p>If i type into a textbox and hit enter, it doesn't change the text property</p>
| 113135 | 1 | 103859 | 1 | 1080337 | uui | 25 | 2020-09-13 21:53:02 | <p>Fixed</p>
|
0 | How to use FindPartOnRayWithWhitelist? | 372313609 | CjayPlyz | 643 | 2021-03-10 14:55:28 | <p>I'm new to rays and I'm currently trying to figure it right now, but I got stuck on this problem:</p>
<pre class='brush: lua'>local UserInputService = game:GetService("UserInputService")
local camera = workspace.CurrentCamera
local viewportPoint = camera.ViewportSize / 2
local unitRay = camera:ViewportPointToRay(vie... | 121157 | ||||||||
0 | math.random printing the same number forever? | 106155155 | InfectedRythmCC | 21 | 2020-10-18 16:26:09 | <p>What I'm trying to do is when a player joins this game, it will roll a number between 1 and 3, If its 1 gui1 opens, and if its 2 or 3 gui2opens, my problem is the first player to join the game, lets say they get a 2 roll, everyone else gets a 2 role, not a 3 or 1. Even when the odds are raised to 1 and 10 it does th... | 114526 | 1 | 105201 | 0 | 70607560 | Unity_456 | 47 | 2020-10-18 16:28:11 | <p>I'd advice that you move "local num = math.random(1,10)" inside of the PlayerAdded function, so it does MathRandom function every time the player is added. Therefore getting a new number.</p>
|
1 | attempt to concatenate string with table? line 27 | 206143181 | Philipceo90 | 13 | 2020-10-17 17:45:56 | <pre class='brush: lua'>local EventsFolder = game.ReplicatedStorage.CodeEvents
local RedeemCode = EventsFolder.RedeemCode
local FeedbackEvent = EventsFolder.Feedback
local MainFrame = script.Parent.HolderBG
local RedeemButton = script.Parent.HolderBG.Holder.RedeemBG.Redeem
local CodeBox = script.Parent.HolderBG.Holder.... | 114484 | 1 | 105162 | 0 | 1029957183 | orcazate | 140 | 2020-10-17 18:00:20 | <p>Hey Philipceo90,</p>
<p>Line 27 needs a bit of tweaking. You should replace the line with this new line of code.</p>
<pre class='brush: lua'> PreviousCode.Text = PreviousCode.Text .." "..tostring(TheCode)
</pre>
<p>In this example, we are turning a table into a string using <code>tostring()</code> to get us a string... |
0 | (Depressed) Ninja Pathfinding AI is quite buggy (?) | 1961959172 | imnotaguest1121 | 362 | 2023-03-06 22:59:46 | <p>Hello Developers!</p>
<p>I created a NPC which is called: "Sad Ninja". Anyway, the NPC has a Pathfinding script which will activate once someone damages the NPC. The Issue however is that the NPC Pathfinding script is buggy, let me explain. When the NPC is chasing a player, the NPC will usually briefly stop in place... | 133152 | 1 | 120236 | 1 | 559514967 | T3_MasterGamer | 2189 | 2023-03-07 01:47:19 | <p>It's more likely because of <a target="_blank" href="https://create.roblox.com/docs/scripting/networking/network-ownership"><strong>Network Ownership</strong></a>. By default, all parts except the players' limbs are owned by the Server. Anchored parts are always owned by the Server, while unanchored parts are not. I... |
0 | Why isn't every player getting added to the table? | 226832508 | MattVSNNL | 116 | 2021-04-05 12:25:02 | <p>I'm making a round-based game and I'm adding every player to a table to get easy access to them but only one player gets in a table, Can anyone tell me why?</p>
<p>Here's the code to add them to the table</p>
<pre class='brush: lua'><br /> local playersAlive = {}
for i, player in pairs(game.Players:GetPlayers... | 122032 | ||||||||
0 | Why does this tool disappear when I playtest and try to clone? | 1196782326 | BACONBOX_MAN | 0 | 2022-05-03 08:59:22 | <p>Hi, So I am making a simulator. I'm trying to make it as original as I can, but the problem is with my shop. The functions it is meant to have is that it clones a tool from ReplicatedStorage into the players backpack, but when I playtest it in studio wherever I put it, it gets hidden and in the output, it says it's ... | 129900 | ||||||||
0 | How do I make a "Player died" message? | 16930058 | Seeker5123 | 15 | 2015-04-08 20:57:57 | <p>How do I make a message appear when a player dies? ( Sort of like the script below)</p>
<pre class="brush: lua">game.Players.PlayerAdded:connect(function(plr)
print(plr.Name.." Has Joined the game")
end)
</pre>
| 16502 | ||||||||
1 | How to get player's profile picture in Roblox? | 808229386 | alexfinger21 | 341 | 2020-05-12 13:23:27 | <p>Hello! So I made a trading system that works fine, but, I want it to have peoples' profile pictures on the trade icon. How would I do that? Thanks in advance =)</p>
| 102833 | 2 | 94954 | 8 | 244452876 | JesseSong | 3916 | 2020-05-12 13:29:20 | <p><strong>What to do?</strong></p>
<p>Hello, so basically you'd use something called <code>Players:GetUserThumbnailAysync</code> this function stores data for players profile pictures.</p>
<p><strong>What you need</strong></p>
<p>You will need an:</p>
<ul>
<li><p>image label</p></li>
<li><p>A local script</p></li>
<li... |
0 | Players are not being teleported. Unable to cast value to object. How do I fix this? | 473052976 | nkminion | 21 | 2021-03-31 16:21:15 | <p>Client Side Code :</p>
<pre class='brush: lua'>local GameId = 6305504610 --Line 148
print("GameId "..GameId) --Line 149
print("PlayerName "..plr.Name) --Line 150
local teleporting = game.ReplicatedStorage.Check:InvokeServer(plr , GameId) --Line 151
</pre>
<p>Server Side Code :</p>
<pre class='brush: lua'>local rs = ... | 121868 | ||||||||
0 | Is there any way to use PreloadAsync to preload assets that are in ServerStorage? | 8775110 | 8391ice | 91 | 2019-04-30 21:34:18 | <p>I keep many of my assets, such as sounds, meshes, and animations in the ServerStorage so that it can be easily accessed by my server-sided scripts. I want all of these assets to be loaded for every player, but PreloadAsync is a client-sided function. Am I going to have to move all of my assets to the client in order... | 79711 | ||||||||
0 | For some reason. My MouseButton1Click script won't even run? Help! | 351467574 | Galaxybombboy | 117 | 2021-02-21 02:59:35 | <p>I'm trying to make a localscript that when the button is pressed. the switch moves to the other side. But i havent even made it to that point!
The "Script.Parent.MouseButton1Click:Connect(function()" Isnt working. Its not even firing. I assume one of the variables is making it wait for eternity or something. Or robl... | 120447 | ||||||||
3 | How to make get Localplayer in a serverscript? | 984384728 | RebornedSnoop | 175 | 2020-07-13 11:05:53 | <pre class='brush: lua'>local plr = game.Players.Localplayer
</pre>
<p>lets say i put a serverscript in the workspace and want to get Localplayer. But the problem is that it doesnt work. I saw articles about this but i dont understand how to solve it. Please help.</p>
<p>Edit : I want to use it like a variable so i can... | 108935 | 3 | 100016 | 2 | 1519151497 | FluffySheep46209 | 369 | 2020-07-13 12:13:37 | <p>I run you through a couple of ways to get the player</p>
<p>Local Script:</p>
<pre class='brush: lua'>local player = game.Players.LocalPlayer
-- Only one needed
Server Script/ Normal Script:
game.Players.PlayerAdded:Connect(function(player)
end)
-- If it's in a gui
local gui script.Parent.Parent.Parent.Parent -- dep... |
0 | How to get all players in team separated by comma? | 553254676 | arkadiusz54 | 2 | 2019-04-17 14:52:42 | <p>I need to get all players in the team.
Every name needs to be a string separated by , .
Like this.</p>
<p>local players = "player1","player2","player3"</p>
<p>Im having a problem with it. Im kinda new.
I think everyone should understand what do i mean.</p>
| 79106 | 2 | 73813 | 3 | 124281858 | DeceptiveCaster | 3098 | 2019-04-17 18:41:52 | <p>As @theking48989987 said, <code>table.concat()</code> is the way to go:</p>
<pre class="brush: lua">local PlayerTable = {}
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Team == game:GetService("Teams")["Team name here"] then
table.insert(PlayerTable, player.Name)
end
end
local Playe... |
0 | Teleport Service - Broken/Not Working?? | 15319024 | ObscureEntity | 294 | 2016-05-10 23:12:19 | <p>I'm trying teleport a player to another place, in the universe, and sometimes it works, but most of the time it prints this in the console:</p>
<p>Teleport Expection: HTTP 400 (HTTP/1.1 400 Bad Request)</p>
<p>Why is this happening, and how I can I fix this error?</p>
| 30471 | ||||||||
10 | Difference between pairs, ipairs, and next? | 28202089 | saltycrabapplez | 58 | 2014-04-18 18:55:02 | <p>Hello!</p>
<p>I'm fairly new at scripting, and I've recently learned about the for loop.</p>
<p>Of course, for i,v in ... is a common form of this loop, and I've seen three variations of it so far.</p>
<p><code>for i,v in pairs</code>
<code>for i,v in ipairs</code>
... and
<code>for i,v in next</code></p>
<p>I've tr... | 2725 | 3 | 3797 | 10 | 27057428 | Tortelloni | 315 | 2014-04-18 19:16:55 | <p><code>for a,b in pairs</code> is a common loop.</p>
|
0 | Is it possible to copy code from a script and paste that code into another script? | 215833213 | Stiles8353 | 10 | 2022-11-11 21:12:47 | <p>The title may be a bit confusing so here's a better breakdown of what I am asking.</p>
<p>Is it possible to, for example take script 2's code</p>
<pre class='brush: lua'>-- hi this is script 2
</pre>
<p>and copy and paste it using script 1</p>
<pre class='brush: lua'>-- hi this is script 1
local script2code = gam... | 132244 | ||||||||
0 | How do I make a part that changecolor every sec when your on the block but stops when ur not on it? | 1394399228 | VeberaXNX | 4 | 2021-02-22 06:24:48 | <p>I know it requires a function with a touched event but i'm wondering if it requires and if statement or while true do loop or repeat and until. Please show me how.</p>
| 120500 | 1 | 109877 | 0 | 2064787945 | Punctist | 120 | 2021-02-22 08:04:03 | <p>Hey! Insert a serverscript inside the part you want to change color of. After that go inside the script and paste this in. Should work! :)</p>
<pre class='brush: lua'>local debounce = false
script.Parent.Touched:Connect(function(hit)
if debounce == false then
debounce = true
if hit.Parent:FindFirstCh... |
0 | Why wont the Text Button become visible? [SOLVED] | 591664527 | zestymeatball | 2 | 2023-01-30 00:39:12 | <pre class='brush: lua'>local checkpoints = game.Players.LocalPlayer:WaitForChild("Checkpoints")
Unlocked200 = checkpoints.Unlocked200
local M200 = script.Parent
while true do
wait(0.01)
if Unlocked200 == true then
M200.Visible = true
end
end
</pre>
<p>Unlocked200 is a bool value, even when the valu... | 132974 | 1 | 120091 | 1 | 1491184861 | 666_brithday | 103 | 2023-01-30 15:26:08 | <p>Don't put numbers for your names can be the first issue second is that you forgot .Value at the end of <code>Unlocked200</code> it needs to be <code>Unlocked200.Value</code></p>
|
7 | How does pcall, xpcall, and ypcall actually work? | 17514438 | TheeDeathCaster | 2368 | 2017-02-01 04:09:58 | <p>I've seen previously in the past the uses of the pcall variations; however, some don't appear to work, and sometimes, to me, they don't work (at all).</p>
<p>One usage I've seen is the following:</p>
<pre class="brush: lua">local player = game.Players.LocalPlayer
pcall(function()
player.PlayerGui.ScreenGui.TextL... | 39638 | 1 | 41864 | 12 | 39250676 | ScriptGuider | 5640 | 2017-02-01 04:49:40 | <h2><strong>pcall</strong></h2>
<p><code>pcall</code> takes a function as it's only argument, and runs it in <em>protected</em> mode (hence the name <em>pcall</em>, or <em>protected call</em>). It always returns two values. The first in which is a boolean that determines whether or not the code ran without error (needl... |
1 | Is it possible to detect what package a R15 player wears? | 51714312 | Rawblocky | 217 | 2017-06-20 18:24:53 | <p>It uses Mesh, but it doesn't use CharacterMesh.</p>
| 44234 | ||||||||
0 | How do you make a vehicle move? | 106975852 | RobskiT | 5 | 2014-04-15 07:21:53 | <p>I am intending to make a train, and i put i a vehicle seat, but, the train doesn't want to move! please help me with this and i will be happy!</p>
| 1551 | 1 | 2861 | 0 | 5726627 | yup3600 | 10 | 2014-04-16 13:32:48 | <p>Make sure that the train is unanchored (to do this I would recommend going into Roblox Studio and unticking the 'anchored' box in properties after selecting the train). As well as this make sure you have used hinges to connect the wheels of the train. Also make sure the whole train is attached to itself using either... |
1 | Developer Products Help :) | 17016147 | BrickThe_DogeLord | 10 | 2014-03-05 19:38:52 | <p>Im testing the new Developer Products feature in roblox, Im a basic scripter i cant make big scripts.
I need help with this one :</p>
<pre class="brush: lua">local buyButton = game.Workspace.StarterGui.ShopMain.MoneyButton
local productId = 19232057
buyButton.MouseButton1Click:connect(function()
game:GetService(... | 503 | ||||||||
1 | Local .Touched running for whole server rather than Client? | 336795835 | Involity | 5 | 2020-06-28 22:12:24 | <p>I have made a localscript where when you step on a part and another part disappears. I am not sure where exactly to put this script, I know it doesn't work in ServerScriptService nor in the workspace or anything inside it, I have tried putting it in StarterPlayerScripts but it is still making the part disappear for ... | 107674 | ||||||||
1 | A little help with LookVector? | 38925257 | AlexAuthority | 22 | 2020-02-16 21:55:56 | <p>I'm making a plane that drops a bomb onto the map, and I want the bomb to be facing the direction of the plane's "bombpart" which is the part attached to plane in which the bombs CFrame is set to. It is not positioning to this part anymore once I added LookVector. I know this is something that can be easily fixed, s... | 94685 | 1 | 87445 | 0 | 44083134 | Fifkee | 2017 | 2020-02-17 01:29:28 | <p>LookVector is just a unit vector, all values ranging from -1 to 1. If you were to try to set a value to the unit vector, it would be super close to (0,0,0). Instead, you should add the LookVector to the part's CFrame in order to get things working. If you want it a distance from said vector, multiply it by a scalar ... |
4 | How do i temporarily weld part to a player? | 39478722 | EzireBlueFlame | 14 | 2018-12-31 05:50:52 | <p>Im trying to do this to learn how to make hitboxes but i dont know how could someone explain welding to me and how to do it?</p>
| 73382 | 1 | 69247 | 2 | 74087102 | Ziffixture | 6797 | 2018-12-31 06:11:01 | <p>Think of welding as anchoring a part, except instead of it floating there not moving, it stays attached to whatever it was told to stick to, even move around with it if you'd like</p>
<p>Judging by the fact you'd like to weld to a character this is what it would look like, and for the example, we'll do an angled swo... |
0 | Whats wrong with this script? | 29422476 | starkiller523 | 65 | 2014-04-30 22:02:42 | <p>So, i'm making a cookie clicker game, and this script does not work...</p>
<p>Also i have 3 leaderstat values,
CPS (Cookies per Second)
CPC (Cookies per Click)
Cookies</p>
<p>ok heres the script:</p>
<pre class='brush: lua'>Player = game.Players.LocalPlayer
CPS = Player.leaderstats.CPS.Value
Cookies = Player.leaders... | 4015 | 1 | 5520 | 0 | 2678811 | Tiranin | 45 | 2014-04-30 22:06:43 | <p>What you did is make variables CPS and Cookies simply numbers. CPS and Cookies need to represent an object:</p>
<pre class='brush: lua'>Player = game.Players.LocalPlayer
CPS = Player.leaderstats.CPS
Cookies = Player.leaderstats.Cookies
while true do
Cookies.Value = Cookies.Value + CPS.Value
wait(1)
end
</pre... |
0 | I'm getting this malformed number error. How do I fix that? | 52261207 | wilsonsilva007 | 373 | 2018-02-25 21:24:16 | <p>What is in the title..</p>
<pre class='brush: lua'>local health = player.Character.Humanoid.Health
script.Parent.Size = UDim2.new(0.health*3.63,0,2.3,0)
</pre>
<p><code>Offset</code> wasn't doing very well so I changed the values to <code>scale</code>.
But when I try to add a <code>0.health</code> it gives me the er... | 54264 | 2 | 53263 | 1 | 58638353 | iishadowflames | 41 | 2018-02-25 21:35:09 | <p>Hmm, you're getting the error because you used 0.health which is not a real number.</p>
<p>Try this:</p>
<pre class='brush: lua'>local health = player.Character.Humanoid.Health
local maxHealth = player.Character.Humanoid.MaxHealth
script.Parent.Size = UDim2.new((health / maxHealth)*3.63,0,2.3,0)
</pre>
|
0 | Body Position positioning me to somewhere random? | 154326189 | XxWingKing | 87 | 2020-06-30 04:11:17 | <p>I do not know the issue. But whenever the BP is used it just positions me to somewhere random? Its supposed to be a jump, and holds the player in air while a projectile fires. (A jump kind of effect into the air) I don't know the problem, but I have attached my script to this thread. Please help!</p>
<pre class='bru... | 107817 | 2 | 99110 | 2 | 56389 | Sparks | 534 | 2020-06-30 04:39:33 | <p>I used to use BodyPositions to hold the player in place while firing a move. When I tried your properties, they kind of flung me all over the place. I suggest using a combination of BodyPosition and BodyGyro to help stabilize the player.</p>
<pre class='brush: lua'>local BG = Instance.new("BodyGyro")
BG.MaxTorque = ... |
1 | How to detect middle mouse button? | 566436191 | habibibean | 77 | 2019-03-23 13:07:51 | <p>I have code that breaks a weld from the player:</p>
<pre class='brush: lua'>local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("CreatePartEvent")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button3Down:Connect(functi... | 78001 | 1 | 73525 | 1 | 126451147 | Lucke0051 | 165 | 2019-04-09 05:33:33 | <pre class="brush: lua"> local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(key)
if key.UserInputType == Enum.UserInputType.MouseButton3 then
--code here
end
end)
</pre>
|
2 | How do I make a group only door? | 52599239 | Alyssall | 0 | 2014-04-19 17:31:13 | <p>How do I make a group only door? I know how to link a game to a group but I don't know how to make doors where only certain ranks can go inside.</p>
<p>Example: A founder room. Only the founder can enter.</p>
| 2882 | ||||||||
0 | ROBLOX radio script? | 25947098 | nikolaaa4 | 0 | 2015-08-09 21:14:09 | <p>Hi.
I've successfully managed to implement a radio system in my game, however, i have noticed that only i can hear the game, other players can't.
I don't know what's wrong, and i don't know who to ask, so here is my script in beg of help</p>
<pre class='brush: lua'>wait(8)
local sound = Instance.new("Sound")
sound.V... | 21191 | ||||||||
0 | How can i make a variable change to true or false when left mouse is pressed? | 402459648 | ruburubuy | 0 | 2021-06-08 12:32:15 | <p>Hi, im trying to make a T-pose animation (like the one in JToH) and i couldn't find how to check for mouse inputs. I'm really new to Lua, but i have some experience with C+ and GML. I could get as far as this:</p>
<pre class='brush: lua'>active = false
script.Parent.Equipped:connect(function()
active = true
end)... | 124192 | ||||||||
0 | Is it possible to redo a 'for' script? | 49468107 | OsterDog | 14 | 2018-05-16 23:39:53 | <p>I'm not asking for code of one example, but I am just wondering.
Could you 'redo' or start over a for script?</p>
<pre class='brush: lua'>for i = 1,10 do
print(i)
end
</pre>
<p>^ This is what I mean. Is it possible to restart it?</p>
| 58520 | ||||||||
1 | How can I use pcall and what does it do? | 566296650 | raid6n | 2326 | 2020-07-19 19:36:56 | <p>I've noticed numerous code with pcall, and I've been wondering how I can use and it and what is does.</p>
| 109466 | 3 | 100546 | 2 | 1708043824 | TheLuminent | 970 | 2020-07-19 19:40:22 | <p>I hope this visual demonstration helps you understand <strong>pcall</strong> a bit more.</p>
<pre class='brush: lua'>local PCALL_SUCCESSFUL,RETURNEDVALUE = pcall(function()
return true -- this would make RETURNEDVALUE = true
end)
if not PCALL_SUCCESSFUL then -- if the pcall function ran into an error then...
... |
1 | Why does my NPC stop moving when its on the players head? | 67015061 | ErskinePierre | 48 | 2020-07-31 20:23:20 | <p>The pathfinding script works ok, the big problem is that if the Player jumps on the bot's head, it will just stand still and do nothing. This also happens if the bot ends up on the players head. This is the script.</p>
<p><strong>A gif of what happens when the player is on the bots head: https://gyazo.com/658f26c3f2... | 110406 | ||||||||
0 | how would i get the cframe of the mouse? I really need it: [Solved by original poster] | 1563294759 | CaIcuIati0n | 163 | 2020-08-02 06:29:45 | <p>uh, so i made a thing where you can rotate a scrollpaper by moving your mouse and holding it down.</p>
<p>It's erroring, since it requires a CFrame, thingy..</p>
<p>It's in a ViewPortFrame, and the currentcamera for it is in the workspace
but the scroll is parented to the viewport frame</p>
<pre class='brush: lua'>l... | 110529 | ||||||||
1 | How to make it so that the numbers don't round off? | 124281858 | DeceptiveCaster | 3043 | 2018-06-15 12:42:33 | <p>This is the timer script for my upcoming Ninja Warrior tournament and I'm having trouble trying to count by tenths of a second. When I do try it, the first 10 intervals (90 to 89) display normally, and then each other number is off by about .0000000004, which is called <em>roundoff error.</em> How do I fix this so i... | 60387 | 1 | 58768 | 1 | 22225270 | ee0w | 458 | 2018-06-15 12:53:36 | <p>There are different ways of doing this, but I'll explain the most simple and straightforward way.</p>
<p>Count down from 900 by 1, then divide by 10.</p>
<pre class='brush: lua'>script.Parent.MouseClick:Connect(function()
for i = 900,0,-1 do
for _,p in pairs(game.Players:GetPlayers()) do
p.Pl... |
0 | Have all parts of a character have collision? | 56923691 | Jo_Bot | 67 | 2018-04-20 23:07:18 | <p>I have a script that turns the character into a "Ragdoll", using BallSocketConstraints, and I need all of the parts to have collision, but the Humanoid seems to force collision on for some parts and force collision off for others. How could I get around this?</p>
| 57143 | ||||||||
0 | how can i use part.color? | 257177021 | 322ita | 11 | 2020-11-21 19:12:34 | <p>how can i use Part.color?</p>
<pre class='brush: lua'>local Sound = script.Parent.button
script.Parent.ClickDetector.MouseClick:Connect(function(click)
Sound:Play()
game.Workspace.cazzo.Canco.CanCollide = true
game.Workspace.cazzo.Canco.Transparency = 0
game.Workspace.Touch01.Material = 288
game.... | 116115 | 1 | 106566 | 1 | 130021889 | SpeedyTV_1 | 76 | 2020-11-21 19:21:11 | <pre class='brush: lua'>local Sound = script.Parent.button
script.Parent.ClickDetector.MouseClick:Connect(function(click)
Sound:Play()
game.Workspace.cazzo.Canco.CanCollide = true
game.Workspace.cazzo.Canco.Transparency = 0
game.Workspace.Touch01.Material = 288
game.Workspace.Touch01.BrickColor = Br... |
0 | How do i remove the decimal of a number value? | 372313609 | CjayPlyz | 643 | 2019-09-14 10:22:58 | <pre class='brush: lua'>local ClickDetector = script.Parent.ClickDetector
local Ranks = {
"Newbie",
"Novice",
"Rookie",
"Beginner",
"Talented",
"Skilled",
"Intermediate",
"Skillful",
"Seasoned",
"Proficient",
"Experienced",
"Advanced",
"Senior",
"Expert"
}
local f... | 87423 | 2 | 80994 | 2 | 29577497 | dualworlds | 90 | 2019-09-14 11:10:34 | <p>Namaste it is i, dual</p>
<p>Normally I would write a really in-depth answer to any question I answer, but this one requires less depth so I'll keep it short.</p>
<p>There are 2 basic methods to do this in the math library</p>
<p>(https://developer.roblox.com/en-us/api-reference/lua-docs/math)</p>
<p>These are <code... |
0 | Why wont this concatenate? | 29018475 | chill22518 | 145 | 2015-01-21 16:51:43 | <p>This is the error that comes when I run the script: Players.Player.PlayerGui.ScreenGui.TextBox.Script:5: attempt to concatenate global 'Power' (a userdata value)</p>
<p>this script is a child of a textbox.</p>
<pre class='brush: lua'>Player = script.Parent.Parent.Parent.Parent
Char = Player.Character
Power = Player:... | 14388 | 2 | 17440 | 1 | 5193371 | Shrekerly | 70 | 2015-01-21 17:04:30 | <p>I believe it is because setting the text of anything requires a string, and it can't find one from that. If it is a StringValue, do this:</p>
<pre class='brush: lua'>script.Parent.Text = "Energy: " .. Power.Value
</pre>
<p>Otherwise if it is another Gui, do this:</p>
<pre class='brush: lua'>script.Parent.Text = "Ene... |
0 | How do I temporarily disable walking animations? | 119496506 | TheLittleLambCraft | 0 | 2019-10-22 23:17:24 | <p>I'm making a game where you can do dances and emotes, and I want some of them to keep themselves on, even after you start walking. When I start the emote it's fine, but when I walk, it turns off again. How do I disable the thing where all animations stop on player move? (I only want it to be temporary, so I can turn... | 89103 | ||||||||
0 | How do I reference the player from a server script? | 25736730 | Lord_Pear | 6 | 2018-05-10 16:47:40 | <p>So this script works when I test on the client, but not in a server. I know it's because I'm trying to reference the player, but I'm not sure how I should be doing it from a server script.</p>
<pre class='brush: lua'>function teleport()
local target
for i, player in ipairs(game.Players:GetChildren()) do
... | 58244 | ||||||||
1 | Is there anyway to detect if a player has liked or favored your game? | 173002126 | Michael_TheCreator | 166 | 2018-01-01 18:11:28 | <p>I'm trying to reward players for giving my game a thumbs up or favorite but I don't know how to find the players liked or favored games.</p>
| 51355 | 1 | 51048 | 1 | 186532095 | Aimarekin | 309 | 2018-01-01 18:58:36 | <p>Hello. That's actually against ROBLOX Rules and Terms of Service. Awarding players for favouring or liking your game is against ROBLOX Rules and Terms of Service. You can incite players in a non-abusive way to like and fav your game, but not to reward them if they do so. Here you have the ROBLOX community rules:
htt... |
1 | How do I fix the error "Attempt to concatenate Instance with string"? | 193503404 | Geozify | 9 | 2021-05-02 00:09:58 | <p>Hello,</p>
<p>I was writing a script, and upon testing it out, <strong>I encountered the error "Attempt to concatenate Instance with string"</strong></p>
<p>I have <em>no idea</em> how to fix this, and the assembly is below.</p>
<p>LocalScript in StarterPlayerScripts</p>
<pre class='brush: lua'>wait(2)
local isowner... | 123013 | 1 | 112090 | 0 | 87493873 | Rampage_Doge | 131 | 2021-05-02 00:14:55 | <p>Server Script</p>
<pre class='brush: lua'>local HS = game:GetService("HttpService")
local WebhookURL = "url would be here when running"
local remoteEvent = game.ReplicatedStorage.RemoteEvent
local function Found(plr,pname, pid)
print(pname)
local MessageData = {
["content"] = pname..pid
}
Mes... |
0 | HapticService HTC Vive Controllers not working? | 100172448 | minecraftbreak | 0 | 2021-05-02 11:48:01 | <p>Hey, so I’ve been experimenting and trying to get the Haptic motors on my HTC Vive Controllers for almost a week now and I’ve just been running around in circles not being able to get it to work. I need help. I’ve searched and studied the API Reference on ROBLOX and got nothing. DevForum though, I saw one post but i... | 123027 | ||||||||
0 | LocalPlayers is not a valid member of Players? Pls Help :( | 1565785833 | 24kLimiteds | 3 | 2020-07-16 05:17:25 | <p>I was Making a Team Choose Client Function and I got this error Local Players is not a valid member of Players :( Someone pls help.</p>
| 109176 | ||||||||
0 | how to i make an automatic gun? | 970040772 | jedistuff2 | 6 | 2020-10-17 23:12:43 | <p>so basically i have an automatic gun that you can spam and its not able to continue firing when i hold down on the mouse</p>
<pre class='brush: lua'>Mouse.Button1Down:Connect(function()
if Reloading == false and Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
local Position = script.Parent.Par... | 114497 | 1 | 105179 | 0 | 674490026 | SteelMettle1 | 394 | 2020-10-18 01:50:04 | <p><code>Mouse.Button1Down</code> only fires once. If you want the code to run multiple times, you'll need a loop of some sort. You'll also need to capture when the player stops holding down the button. Here is a quick example of this:</p>
<pre class='brush: lua'>--let's assume you have a tool.Equipped somewhere that s... |
0 | What did I do wrong?? Please help (Involved changing events) | 18970290 | Jonathox | 4 | 2018-04-19 01:34:01 | <p>Im creating a core, that activates a ton of effects once the temperature reaches 1600 degrees, and heres what I have</p>
<pre class='brush: lua'>wait(1)
local act = _G.actvalue -- The global value
local inuse = false -- This is neccecary only for the script to not break
function alarmchange(button)
if not inuse ... | 57063 | 1 | 55770 | 0 | 44083134 | Fifkee | 1956 | 2018-04-19 03:18:03 | <p>Put the conditional statement in a loop. You might have to change your stuff though. The conditional statement only works once, and it wont reactivate itself after the script runs by it. (unless you meme'd it around and put it in a loop or some other stuff like that)</p>
|
1 | Script doesn't work at all but nothing shows in the output weird, is this a glitch/bug? | 525025404 | Nitrolux200 | 62 | 2021-02-22 05:30:32 | <p>This script doesn't work but nothing shows in the output so i'm completely lost right now.
Can somebody help?</p>
<p>Script:</p>
<pre class='brush: lua'>db = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
if db == false then
db = true
... | 120499 | ||||||||
0 | Making all children visible false? | 358294883 | LegoUnicornRoblox | 37 | 2019-08-22 20:18:19 | <p>Hello I've written this script</p>
<pre class='brush: lua'>script.Parent.MouseButton1Click:Connect(function()
local Children = script.Parent.Parent:GetChildren()
Children.Visible = false
end)
</pre>
<p>but it doesn't make the children <strong>visible false</strong>?</p>
| 86351 | 2 | 80079 | 0 | 50969508 | ForeverBrown | 356 | 2019-08-22 21:27:25 | <p>You want to iterate through with a for loop</p>
<pre class='brush: lua'>script.Parent.MouseButton1Click:Connect(function()
local model = script.Parent.Parent:GetChildren()
for i,v in pairs(model)do
v.Visible = false
end
end)
</pre>
|
0 | What's the issue with my script? (attempt to call a nil value) | 62087109 | Raccoonyz | 893 | 2020-01-27 13:01:25 | <p>I have this plugin script right here. However, it doesn't work. What's my issue? It yields Script.lua:9: attempt to call a nil value</p>
<pre class='brush: lua'>local toolbar = plugin:CreateToolbar("Number of Descendants")
-- Add a toolbar button named "Create Empty Script"
local newScriptButton = toolbar:CreateButt... | 93675 | 1 | 86555 | 0 | 1281291441 | ankurbohra | 681 | 2020-01-27 13:22:47 | <p>game.Selection:Get() gives you an array of objects, not just one object, since multiple objects can be selected simultaneously. Hence the model — if only the model is selected — will actually be game.Selection:Get()[1].</p>
|
1 | Why won't some metamethods work properly? | 559514967 | T3_MasterGamer | 2189 | 2022-09-19 09:44:06 | <p>I'm using metamethods for my <strong>"Number Instance"</strong> module to act like real numbers. Most of the metamethods are working fine, except for these three: <code>__eq</code>, <code>__le</code>, and <code>__lt</code>. They are scripted the same way with <code>__concat</code>, <code>__add</code>, <code>__sub</c... | 131673 | 1 | 118918 | 1 | 1792778813 | Xapelize | 2658 | 2022-09-19 10:31:43 | <p>It turns out <code>__eq</code>, <code>_lt</code>, and <code>__le</code> doesn't fire if the other <strong>token</strong> is a different datatype from the class.</p>
<p>For example:</p>
<p><code>MyCustomClass == "30"</code></p>
<p>Let's say you have a backend code that helps you to return the value <code>MyCustomClas... |
0 | Badge for meeting a player? | 148918589 | pixielatedd | 2 | 2022-05-19 19:14:44 | <p>I've created a "you met the owner" badge and it works for me as I am the owner, however I would like to create another badge that is awarded for meeting another player i.e. a YouTuber. I'm not sure why my code isn't working.</p>
<pre class='brush: lua'>local Id =2126366798
game.Players.PlayerAdded:Connect(function(P... | 130047 | 1 | 117457 | 0 | 226832508 | MattVSNNL | 378 | 2022-05-21 15:35:59 | <p>The way you are identifying if the player is you is pretty bad!</p>
<p>You are looking for your name, if you change your name the code will not identify you as the owner!</p>
<p>I cooked up a better code for you, hope this helps! If it does, I'd be very happy if you accept my answer!</p>
<p>It's a code in ServerScri... |
20 | What's the difference between ' and "? | 6938287 | spiffyjohn53 | 100 | 2014-07-17 13:19:59 | <p>I'm pretty sure they work the same, but have different meanings.</p>
<blockquote>
<p>print ('Hello World')</p>
</blockquote>
<p>vs</p>
<blockquote>
<p>print ("Hello World")</p>
</blockquote>
| 8259 | ||||||||
1 | How Can You Make A Photo-Realistic Ray Tracing Game In Roblox? | 275257157 | marsdonh | 36 | 2020-03-30 00:53:48 | <p>I'm trying to make a game in roblox and i want the game to be as realistic as possible and one part im really stumped on is trying to get things to ray-trace since building has never been one of my strong points. If anyone has any tips on how i could do ray-tracing and photo-realism i would very much appreciate it.<... | 97505 | 1 | 90477 | 0 | 850897625 | QuantumxGeneral | 25 | 2020-04-03 11:36:08 | <p>Got to View and click on Explorer.
Add the following objects to** lighting**, which you can find using the Explorer:
Bloom
ColorCorrection
SunRays</p>
<p>This will help to enhance photoRealism in your game!</p>
|
0 | How do you make it so it teleports when the timer ends? Im trying to make a story game. | 1898562946 | zoietheburntchicken | 0 | 2022-05-06 01:38:00 | <p>The code:</p>
<pre class='brush: lua'>local TS = game:GetService("TeleportService")
local TweenService = game:GetService("TweenService")
local placeId = "6878438976"
local leaveGuiEvent = game.ReplicatedStorage.LeaveGuiEvent
local TransitionEvent = game.ReplicatedStorage.TransitionEvent
local list = {}
local gui = s... | 129922 | ||||||||
0 | [SOLVED] when block hovered over it shows a 0.5 transparent block. why is it not working? | 1044877460 | MariamOMG090 | 9 | 2023-02-21 16:56:12 | <p>when you hover over a block its supposed to show a 0.5 transparent block. The block has to be named "Cannotdelete" so you can hover over it. But the script is not working. Please somebody tell me why. Gives me an error that says: MouseEnter is not a valid member of Part "Players.PreviousSchmuck.Backpack.PlaceBlock.H... | 133099 | ||||||||
1 | [Solved] Looping player rotation glitches out, sorta spasms character? Any way to do it smoothly? | 419000434 | Omq_ItzJasmin | 666 | 2021-04-13 14:37:04 | <p>Edit: Ended up just using water lol.</p>
<p>SORRY IM ASKING TOO MANY QUESTIONS. But I have a little gravity test thing I'm working on and I want to rotate the player around slowly, but it glitches a lot. Do I need to add something or change anything? Here is my server script:</p>
<pre class='brush: lua'>local TweenS... | 122330 | 1 | 111441 | 1 | 1792778813 | Xapelize | 2602 | 2021-04-13 14:47:51 | <p>Consider using remote event, it causes more less lag than tweens. Also if it doesn't work can you show your microprofiler because I wanna see if it's a lag issue?</p>
|
0 | How do i make not deletable script in players character? | 821459157 | TemaTechYT | 2 | 2021-10-04 15:36:48 | <p>How do i make not deletable script in players character? So, when character dies, the script not deletes.</p>
| 127793 | ||||||||
0 | how do i make it drop from inventory? | 609694350 | thedukke1 | 9 | 2023-03-05 12:00:35 | <p>Well i have this script where it works like an inventory gui
Rn i have made it so you lose your item when clicking on it
but i want it to be copied right infront of you (player) in workspace</p>
<pre class='brush: lua'>local button = script.Parent
button.Position = UDim2.new(0.032, 0, 0.5, 0)
local open = false
butt... | 133144 | ||||||||
0 | Help me with tree chopping script? | 14971205 | Yeevivor4 | 155 | 2015-02-23 01:32:09 | <pre class="brush: lua">hits = script.Parent.hit --This keeps track of how much "hp" the tree has left
local newtree = script.Parent:clone() --for inserting a new tree later
while true do --infinite loop
if hits.Value < 1 then --if the tree has less than 1 "hp" then
script.Parent:BreakJoints() --make tree able t... | 15236 | ||||||||
1 | Moving objects in script? | 41100413 | BSIncorporated | 640 | 2015-05-03 19:26:59 | <p>I have tried this in every way I could think of and in WILL NOT move the object (btw, I don't need the model to be there, that was just another failed attempt)</p>
<pre class="brush: lua">while wait (5) do
Model = Instance.new("Model", workspace)
Ball = Instance.new("Part", Model)
Ball.Shape = "Ball"
... | 17247 | 1 | 20632 | 0 | 79451355 | SurVur | 86 | 2015-05-03 20:40:54 | <p>On line 10, you are changing the Position. You are attempting something along the lines of :
<code>Vector3.new(Vector3.new())</code></p>
<p>The Position property already returns a Vector3, there is no need to create a new one and it will throw an error.</p>
|
0 | Decal script not working when script.parent is stated? | 328413134 | LiLFriks | 39 | 2018-02-04 01:02:41 | <p>This script only works when I put -</p>
<pre class='brush: lua'>local d = game.workspace.poster.decal
</pre>
<p>but the problem is, I want to put this poster inside of a model, and duplicate that model multiple times. It won't work. Just so you know, the part that is affecting it is</p>
<pre class='brush: lua'>local... | 53125 | ||||||||
0 | How do I fix attempt to index nil with 'PlayerGui'? | 999502939 | Dragonboy99711 | 5 | 2021-08-20 05:34:21 | <p>I've been trying to code some dialogue, it works perfectly so I decided to add options to it. But for some reason I keep getting this error that I don't usually encounter in coding. I'm sorta just a beginner so can anyone help me?</p>
<pre class='brush: lua'>--Error message was:
Players.Dragonboy99711.PlayerGui.Main... | 126675 | ||||||||
0 | How do I make a Frame size change? For now I use + UDim2.new(0,2,0,0) | 73884919 | MineJulRBX | 52 | 2017-05-06 20:50:58 | <p>How do I make the size change for every loop?</p>
<pre class="brush: lua">for n = 0, 100 do
textbutton.Text = "Loading..."
frame.Size = loader.Size + UDim2.new(0,2,0,0)
wait(math.random(0.4,0.5))
end
</pre>
| 42680 | 2 | 44281 | 0 | 294191579 | GuestRealization | 102 | 2017-05-08 13:10:34 | <p>Here is a script from my game that increases the loading bar by 0.009 every loop.
It makes it look like a slow moving loading bar.</p>
<pre class="brush: lua">p = script.Parent
il = script.Parent.ImageLabel
for i = 1, 100 do
il.Size = il.Size + UDim2.new(0.009,0,0)
p.Text = "Loading Tumble-Slides "..(i*1).." %"
wait... |
4 | Making a Gui Visible when you hover over another players character? | 49316000 | IntellectualBeing | 430 | 2014-04-22 03:04:41 | <p>What methods should I use if you hover your mouse over another players torso and it brings up a Gui at the mouse position?</p>
<p>Should I use OnMouseHover? I'm not really sure how to make the gui appear at the position of the mouse when they hover either?
Can anyone go in depth on how to do this?</p>
<p><strong>My ... | 3249 | 1 | 4541 | 3 | 20901244 | Aethex | 255 | 2014-04-22 04:16:53 | <p>As a LocalScript inside of the GUI, you would use the <a target="_blank" href="http://wiki.roblox.com/index.php?title=Move">Move</a> event to check when the mouse is moved and you would get the mouse's target (mouse variable.Target) to get the target the mouse is at. You would then check if it was a player and make ... |
0 | this math.random script only runs once, even with a loop. why does it do this? | 1240513373 | subtokeith | 5 | 2023-01-23 12:05:04 | <p>im trying to make a plates of fate type game with random events, but the math.random only does it once. if i run the script it only does one event then it just repeats that same event
ive tried using a while true do loop but it didnt work
i reverted the script so that i didnt change anything
Can you maybe rewrite wh... | 132923 | 1 | 120051 | 0 | 158811 | TGazza | 1321 | 2023-01-23 13:37:43 | <p>When using <code>while true do</code> loops. You need something to <code>break</code> out from the loop, otherwise it will continue looping forever. So with that in mind, I've gone over your code and implemented a timer for your while loops, so they can break out after a time.</p>
<p>The modified code is as follows:... |
0 | I have issues with script Parent, it is not working help zzzz ? | 991359031 | LaaserPrimeYT | 1 | 2020-09-13 15:24:17 | <p>Hello i'm a begginer scripter but i have issues with the parent change, here is the script</p>
<p>script.Parent.Parent = workspace</p>
<p>but when i run the game the script parent isn't workspace, how can i fix this ?</p>
| 113119 | ||||||||
0 | Why is zacksisk in every one of my parts and scripts? | 51565960 | mastersniper7399 | 15 | 2014-10-30 00:08:56 | <p>There is a script called zacksisk in every one of my parts, scripts, and everything else. Why is this happening it is breaking my game!? Nobody can play it. it says loading until you get disconnected whats the problem?</p>
| 12064 | ||||||||
0 | ? connect a remote event - to resize local player | 285411299 | dwanedibbley | 10 | 2021-04-29 10:27:48 | <p>rigtype of local player is R15, not sure what i'm doing wrong...</p>
<pre class='brush: lua'>-- MAKE PLAYER BIGGER
game.ReplicatedStorage.PlayerBigger.OnServerEvent:Connect(function(player)
local humanoid = player.Character.Humanoid
if humanoid then
if humanoid.BodyWidthScale then
print("... | 122926 | 1 | 112005 | 0 | 371637657 | ssgmalachi | 52 | 2021-04-29 17:20:08 | <pre class='brush: lua'><br />game.ReplicatedStorage.PlayerBigger.OnServerEvent:Connect(function(plr)
local myVar = nil -- put the number you want your player to grow right here
local character = plr.Character
local humanoid = character:WaitForChild("Humanoid)
humanoid.BodyWidthScale.Value += (myVar)
end)
</pre>
<p>If ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.