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 | How to make a realistic and smooth elevator using PrimaryPartCFrame? | 559514967 | T3_MasterGamer | 2127 | 2022-04-20 05:20:26 | <p>Hello! I'm trying to make a moving elevator using for my game (both lobby and game) and I found this script in a question. I tried it myself and it did work, but when I test it out I keep glitching out of the map, the elevator is glitching, going up and down for no reason at all, and randomly teleports up and down w... | 129734 | 1 | 117275 | 1 | 182583259 | NEILASc | 84 | 2022-04-20 14:01:24 | <p>the lerp function <a target="_blank" href="http://"></a>only takes 2 inputs. one of them is time (0 to 1) and the end position or cframe or value of anything.</p>
<p>example: your start position is 0,0,0 and end position is 0,10,0. and you use the lerp function and the time is set to 0.5. the current position would ... |
0 | Why Is My Soccer Goalkeeper Not Moving? | 5360723 | jacobwow | 140 | 2014-11-15 17:55:12 | <p>I made a soccer goalkeeper that teleports behind the ball when it goes inside of a certain area to block the shot. However, it does not work. Here is the script:</p>
<pre class='brush: lua'>local Save1 = game.Lighting.Save1
local Ready = game.Lighting.Ready
local gameBall = game.Workspace.gameBall.Handle
function Sa... | 12477 | ||||||||
0 | How to make path finding? | 44860977 | BowtiesAreCool001 | 0 | 2014-04-17 13:34:14 | <p>I'm making an AI and I can't seem to figure out where to start for path finding, Can anyone help?</p>
| 2427 | ||||||||
0 | How To Make The SkyBox Change When A Player Is In A Certain Region? | 1554573538 | kidsteve923 | 71 | 2021-05-02 08:02:32 | <p>Hey Devs I Wanted To Ask On How Do I Make The Sky Box Change When The Player Is In A Area And Then When He Leaves The Area The Sky Box Changes Back To What It Was. Similar Function can Be Seen In The Game Epic Minigames</p>
| 123024 | ||||||||
0 | Why is my local parts script not working correctly? | 157510912 | General_Scripter | 425 | 2014-11-15 15:38:02 | <p>I have used local parts before, and they worked fine. I used the same scripting and changed the part's CFrame. It doesn't put the parts where I want them to go. I don't know why this is but I hope you do. Here is the script:</p>
<pre class='brush: lua'>Permission = {"UndiscoveredLimited","Idontcare2004","moonmim","A... | 12472 | 1 | 15519 | 0 | 1002773 | Spongocardo | 1991 | 2014-11-15 15:48:12 | <p>Firstly, you must use game.Workspace.CurrentCamera. You can't make a specific camera for holding local parts.</p>
<p>Secondly, you need to make a variable which includes the function in it, so that the if statement on line 18 works.</p>
<p>Also, I'd recommend using local variables for Part1, Part2, etc.</p>
<pre cla... |
0 | Problem? Body is not a valid member of player. Please help, I have no clue of the issue. | 231423324 | ghxstlvty | 133 | 2021-09-14 02:05:07 | <p>Body is not a valid member of player ('Players.<em>name</em>.PlayerGui.SirenControl.Frame.MainHandler', Line 2</p>
<p>I am not trying to reference the player in any way, shape, or form in this script I don't know why it's saying this.</p>
<p>I know line 2 in my script is written correctly, I used the LUA autofill to... | 127426 | ||||||||
1 | How would I set the face of a texture in a script? | 178739247 | CocoDysphoria | 37 | 2021-06-08 23:06:21 | <p>Hello! I'm making an old roblox simulator called Nostalgia Studio and I am currently working on making surface types work. I've got the textures for studs, inlets and universal and I am currently trying to make it create a new texture for each brick created via a script, but I've had trouble setting the texture's fa... | 124209 | ||||||||
0 | Door system always doesn't open with or without a keycard in the backpack? | 1606745884 | EricAndTheWell | 11 | 2023-02-19 10:49:54 | <p>Hello!</p>
<p>Let's cut to the chase, I am attempting to make a keycard system in which you have to click the keycard scanner with a keycard in your backpack.</p>
<p>(I did this instead of having to check for a keycard in their character, because apparently clickdetectors don't work with tools on)</p>
<p>Now, there ... | 133091 | ||||||||
0 | Why do i get an Http error 401 when uploading an animation? | 2021733653 | DaCookieArchitect | 3 | 2021-02-23 15:04:12 | <p>So i was uploading an animation to use and for some reason it gave me an HTTP error 401 (Unauthorized). I tried changing the name of the animation because that can cause errors if its a name roblox's chat filter wouldn't allow, but that didn't work. Could anyone help?</p>
| 120564 | ||||||||
0 | How do I make it so only the person that finished the quest gets money? | 660109478 | Cikeruw | 14 | 2022-06-21 11:06:26 | <p>There is this script that is for a quest where you face a villain. But when you get the quest it will notify the server. But when the npc dies everyone who is doing the quest gets money how do I fix this.</p>
<pre class='brush: lua'>local NPC = game.Workspace["NPC That Follows You"]
game.ReplicatedStorage.fightingqu... | 130436 | ||||||||
0 | how to detect players in a region3? | 55310986 | hokyboy | 203 | 2020-08-01 15:18:04 | <pre class='brush: lua'>local RegionHolder = workspace:GetChildren(workspace.RegionHolder)
while true do
wait(1)
for i,part in pairs(RegionHolder,nil,1000) do
if part.Parent:FindFirstChild("Humanoid") ~= nil then
print("Player Was Found In region")
end
end
end
</pre>
<p>this is my cu... | 110473 | ||||||||
1 | How to make vehicle autodespawn after some time if nobody is using it? (closed) | 79000540 | kazeks123 | 195 | 2016-07-08 11:35:06 | <p>My target was to create a script that destroys the vehicle after like 20 seconds if nobody is sitting in the vehicle seat. This is what i came up with:</p>
<pre class='brush: lua'>while true do
wait(20) -- after 20s check if vehicle is occupied or not
local seat = script.Parent.VehicleSeat
local occ... | 32803 | 3 | 35738 | 0 | 18847344 | Omarstein | 100 | 2016-07-08 16:53:52 | <p>A VehicleSeat already has the property <a target="_blank" href="http://wiki.roblox.com/index.php?title=API:Class/Seat/Occupant">"Occupant"</a>, so this is how I'd go about doing it:</p>
<pre class='brush: lua'>local car = script.Parent
local seat = script.Parent.VehicleSeat
-- change the car and seat variables if th... |
0 | Argument 2 missing or nil? | 206143181 | Philipceo90 | 13 | 2020-09-04 22:37:05 | <pre class='brush: lua'>while true do wait(30)
local WaitTime = math.random(2,5)
game.ReplicatedStorage.SaveDataStatus.Value = "Saving Data..."
for i,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.SaveDataStatus.SaveMsg.TextColor3 = Color3.fromRGB(255,255,0)
end
... | 112704 | 1 | 103448 | 0 | 468944525 | CreationNation1 | 368 | 2020-09-04 23:04:30 | <p>If you are getting userId, you should do <code>Player.UserId</code>. Otherwise, if <code>PlayerUserId</code> is a variable, then there shouldn't be an error. In this case, you could use a <code>pcall</code> to run this event.</p>
<pre class='brush: lua'>while true do wait(30)
local WaitTime = math.random(2,5)
... |
1 | How can I disable camera control via mouse click? | 25516360 | Zerio920 | 285 | 2015-05-09 21:49:23 | <p>The right-mouse button can be used to adjust the camera if need be. However, I'd like to disable this so the only method of camera control the player has are the left and right arrow keys, which rotate your camera left and right if you haven't tried them. Any ideas?</p>
| 17406 | ||||||||
0 | Help with making a bouncy character script *without* creating instances? | 285616474 | RedWirePlatinum | 53 | 2023-04-02 01:40:15 | <p>So basically, with this script I either bounce little to none at all or way too much from large enough heights, what can I do?</p>
<pre class='brush: lua'>local Changed = function(part, PropertyName, func)
local current = part[PropertyName]
local elapsedTime = 0
coroutine.resume(coroutine.create(function... | 133258 | ||||||||
0 | How to find the cframe between 2 points? | 1002868093 | Altives | 17 | 2020-08-04 03:25:55 | <p>So i'm not too advanced in lua but does any know how to do this
ok so here is 2 points
Point 1 CFrame = -27.9838257, 681.122009, 725.862732
Point 2 CFrame = -48.4227066, 681.293396, 701.498535
How will i get the cframes between these two points
I'm trying to find an answer so i could make an auto build type of scrip... | 110667 | 1 | 101640 | 0 | 52208338 | Spiritlotus | 151 | 2020-08-04 03:38:25 | <p>first of all those look like positions, as they are Vector3 values.
secondly, there is no “CFrame between parts”. A CFrame represents both the position and the rotation of a SINGULAR part.
you want the distance?</p>
<p>(part1.Position - part2.Position).Magnitude</p>
|
0 | No Modern Documentation On Datastore2 Tables. Why? | 503118072 | APaperDeveloper | 3 | 2020-05-25 18:08:53 | <p>Hey there. I have spent the past couple weeks searching through documentation on tables with Datastore2.</p>
<p>I have only found old posts that dont work anymore. Its becoming a huge issue, and Roblox's main Datastore has a lot of issues.</p>
<p>If anyone can redirect me to a good source thats been updated in the p... | 104314 | 1 | 96289 | 3 | 49773669 | cowsoncows | 926 | 2020-05-25 18:20:15 | <p>Datastore2 isn't an official library supported by Roblox, it's simply a user created module (Created by Kampfkarren) that uses a unique method of managing data. Therefore you won't find any documentation of it on the wiki.</p>
<p>The official documentation for the module can be found <a target="_blank" href="https:/... |
1 | How can you animate a tool using roblox animations ? | 8234369 | DrThunder80 | 10 | 2016-12-01 01:41:59 | <p>Like if you just wanted to move the handle of a tool instead of it being stuck to just wherever the toolgrip is.</p>
| 37653 | 1 | 40130 | 2 | 28420043 | Anthony9960 | 210 | 2016-12-01 02:03:57 | <pre class="brush: lua">How I animate a tool is by copying a handle of a tool into the player and welding the handle to play player's hand with Motor6D by scripting, because Motor6D is how your player is connected and animated.
</pre>
<p>I would use this script, but it's for animating an NPC. Anchor the HumanoidRootPar... |
0 | Script not Checking if BoolValue == true, Why? | 64239721 | KoalaTech | 6 | 2021-05-04 08:33:55 | <p>So I have a a <code>LocalScript</code>that actives a <code>RemoteFunctions</code>. That <code>RemoteFunction</code>sets a <code>BoolValue</code>within the <code>LocalPlayer</code>to true, on the Server and Client.</p>
<blockquote>
<p>These scripts are working perfectly fine ^</p>
</blockquote>
<p>I have another scri... | 123079 | 2 | 112166 | 0 | 94006350 | BulletproofVast | 385 | 2021-05-04 12:44:47 | <p>It would be easier to just fire the event and check if it's unlocked in the server script. This would prevent exploiters from spamming as well.</p>
|
0 | How to have a certain amount of decimals on an fps counter? | 1389886885 | ILikeBaked_Beans | 12 | 2021-06-09 20:30:01 | <p>Question basically says it all, I made an fps counter but the number becomes really long.</p>
<pre class='brush: lua'>while true do
wait (0.01)
script.Parent.Text = game.Workspace:GetRealPhysicsFPS() .. " fps"
end
</pre>
| 124229 | ||||||||
0 | When to use brackets? | 37028145 | SonicIronic143 | 5 | 2015-10-25 04:10:22 | <p>So in many scripts, there are parenthesis, brackets, and braces. I know what the function of parenthesis and braces are, but what is the point of brackets <em>[]</em>? And when do you use them? I would really appreciate if someone would answer!</p>
| 23826 | ||||||||
0 | Looking for help on how to upload a mesh? | 16258861 | IzzyUriee | 0 | 2019-06-19 20:54:24 | <p>So I just recently began learning how to script and I don't have a lot of knowledge on this subject but I was wondering how to upload a mesh. At first, I opted on watching videos on how to upload one into Roblox Studio. I understood most of it, but what really confused me was the whole FBX file thing. I have no idea... | 82092 | ||||||||
0 | Created part floats to the camera Why? | 297242360 | antoniorigo4 | 117 | 2020-01-01 07:03:21 | <pre class='brush: lua'>local function Draw()
while wait() do
if LeftDown then
local PartP = Instance.new("Part",trash)
PartP.CanCollide = false
PartP.Size = Vector3.new(1,1,1)
PartP.Material = Enum.Material.Neon
PartP.Anchored = true
PartP.Position = mouse.Hit.... | 92333 | 1 | 85476 | 2 | 111523961 | Azure_Kite | 870 | 2020-01-01 07:37:41 | <p>Because you aimed at the part, so the new mouse.hit.p would be the surface of the part, it keeps getting the surface of the part thats why it fly towards you</p>
|
0 | How do I allow a player to teleport to a certain point when pressing a TextButton? (Solved) | 461604490 | 2Loos | 145 | 2020-11-23 21:23:23 | <p>LocalScript, parented under a few frames and a screengui under StarterGui.</p>
<pre class='brush: lua'>local SPAWNPOINTPOSITION = Vector3.new(-262, 589.8, 430)
script.Parent.TextButton.MouseButton1Click:Connect(function(player)
local char = player.Character
char.HumanoidRootPart.CFrame = CFrame.new(SPAWNPOIN... | 116225 | 3 | 106655 | 1 | 296879280 | CoIorEvent | 20 | 2020-11-23 21:39:43 | <p>You <strong>must define the player</strong> in the first example you gave. An example of what your script could look like.</p>
<p>Updated Script:</p>
<pre class='brush: lua'>local player = game.Players.LocalPlayer
local SPAWNPOINTPOSITION = Vector3.new(-262, 589.8, 430)
script.Parent.TextButton.MouseButton1Click:Con... |
0 | How to check and see If the player has a certain amount of Items Inside of there backpack? | 1961959172 | imnotaguest1121 | 287 | 2022-08-07 22:46:15 | <p>Hello!</p>
<p>I am making a crafting system where If you have 5 of the same certain Items (Example: Sticks) then you can create something else, like a sword or something, the problem Is that I don't know how to check It the player has more than 1 certain Item for It to be crafted</p>
| 131137 | 1 | 118458 | 1 | 74087102 | Ziffixture | 6913 | 2022-08-08 03:50:23 | <pre class='brush: lua'>local function getChildrenNamed(name, amount, parent)
local children = {}
local childrenLeft = amount
for _, child in parent:GetChildren() do
if child.Name == name then
table.insert(children, child)
childrenLeft -= 1
if childrenLeft == 0 t... |
1 | How to make a button that ”activates” a part just while is touched? | 146100287 | Gigaset39 | 103 | 2023-01-23 10:04:08 | <p>Hello world! Im creating a 2 player obby:</p>
<p>How to make a Button that turns a part to Transparency = 0 and CanCollide = true just while is touched?
soo , as soon as the player doesent touch anymore that Button, the Part whil go back to Transparency = 0.6 and CanCollide = false.</p>
<p>Curently i use this:</p>
<... | 132922 | 1 | 120049 | 1 | 559514967 | T3_MasterGamer | 1736 | 2023-01-23 11:56:00 | <p>You can use the <a target="_blank" href="https://create.roblox.com/docs/reference/engine/classes/BasePart#TouchEnded"><code>Part.TouchEnded</code></a> event which detects if a part un-touches the part.</p>
<pre class='brush: lua'>local button = script.Parent.Button
local part = script.Parent.Part
button.Touched:Conn... |
0 | UserOwnsGamePassAsync is not working and there is no output? | 293872889 | Galicate | 106 | 2018-07-01 08:05:04 | <p>I tried gamepass service and marketplace service and NONE of them have worked at all. I get no error when using UserOwnsGamePassAsync and no output whatsoever. The only output is on line 2.</p>
<pre class='brush: lua'>script.Parent.Parent.DialogChoiceSelected:Connect(function(player, choice)
print("Selected to e... | 61558 | ||||||||
0 | How do I allow head/torso to go through the floor for an animation? | 313520634 | Vegemite141 | 0 | 2021-01-13 15:16:46 | <p>So in my game, I am trying to make a thing where if you hit a key, your character goes into the floor. I have the animation for my character to go into the ground, but when I try to use the animation in game, it stops when my torso hits the floor. I have looked around and seen that I can use collision groups, and mo... | 118643 | ||||||||
0 | I'm not sure if this framework script will work for my guns? | 137505940 | GameBoyOtaku | 63 | 2017-09-09 23:36:39 | <p>I have very basic scripting skills and I'm not asking for scripts I just wanna know what kind of categories I would need to learn so I can make a good fps, take phantom forces or last strike for example, of course I can't make one as good as those but I would like to make a fps that is good and playable.</p>
<p>I ca... | 47764 | ||||||||
1 | Car Spawner (Cloned Car rename to Players Name)? | 881357001 | zEmirYT | 7 | 2022-07-30 18:53:24 | <p>Hello! im scripting an Car Spawner. But im not sure why the script is not working.</p>
<p>I want make, that if you click at the button, that a cloned car from the ServerStorage the Name from the player has (Owner).</p>
<p>May someone can help me</p>
<p>My script:</p>
<pre class='brush: lua'>local Button = script.Par... | 131016 | 1 | 118358 | 0 | 1155618520 | Lightning_Game27 | 232 | 2022-07-31 01:01:27 | <p>You cannot access ServerStorage from a LocalScript! What you will need to do is create a RemoteEvent in ReplicatedStorage called "SpawnCar".</p>
<p>Then in your local script:</p>
<pre class='brush: lua'>local Button = script.Parent.Parent.Button
local player = game:GetService("Players").localPlayer
local Event = gam... |
2 | My script stopped working when using animation controller without any reasons, why? | 638607128 | 5412366La | 12 | 2021-01-05 12:10:29 | <p>i have no idea how is it not working, im using an animation controller on a model.</p>
<p>code:</p>
<pre class='brush: lua'>local gasteridle
local gasteropen
local gasterfire
local animctrl = gb.AnimationController
local idleanim = gb:WaitForChild("Idle")
local openanim = gb:WaitForChild("Open")... | 118217 | 1 | 108165 | 1 | 377679694 | TheB4dComputer | 100 | 2021-01-05 13:23:28 | <p>I might try not defining the Animationcontroller with local. Try accessing it with gb.</p>
<p>Animations are weird, I know. They don't like local, they prefer the rig they were made with. That's a big one as well. Did you animate the animations with the rig you're trying to use? That may be why they won't play.</p>
|
1 | How would i go about doing math.random but with rarity chances?. | 171340748 | maxpax2009 | 335 | 2020-05-26 10:51:53 | <h1>QUESTION 1</h1>
<p>I'm making a game like MM2 - short for 'murderer mystery 2', which is a murder game.</p>
<p>You can buy cases, but i want a certain class of item to be rarer of the other;</p>
<h1>QUESTION 2</h1>
<p>How do i make a percentage of something.</p>
<p>Like if i want 70% of the acre to be filled with d... | 104392 | 3 | 96363 | 2 | 14277028 | rodrigo455 | 578 | 2020-05-26 11:37:02 | <pre class='brush: lua'>local rarities = {
Common = { probability = 699/1000 };
Uncommon = { probability = 200/1000 }; -- i.e. 2/10
Rare = { probability = 100/1000 }; -- i.e. 1/10
Legendary = { probability = 1/1000 };
};
function getRarity()
local probability = Random.new(tick()):NextNumber()
... |
0 | How to position an gui that will be at the same location of the screen on all types of devices? | 137722591 | StarLordEnzoGamer | 17 | 2019-01-27 13:55:16 | <p>I really want to make an gui that be on one position of the screen on all types of devices. I tryed watching videos on youtube but it didn't work. How can i position an gui perfectly for all devices?</p>
| 75259 | 1 | 70755 | 0 | 849198397 | jdm4llfem8 | 94 | 2019-01-27 14:14:09 | <p>Your probably scaling in studs. For e.x. Your frame size is (0,100),(0,100).</p>
<p>You have to scale them by size, which is then (0.1,0),(0.1,0).</p>
<p>If you wanna scale the gui with the mouse, make the size (1,0),(1,0), then resize it with your mouse.</p>
|
0 | How can I make my tool deal a specific amount of damage ONLY when its animation plays? | 104269101 | kingsworld9 | 4 | 2021-04-06 23:06:22 | <p>To clarify, I want to know how I can STOP it from dealing damage when the tool is NOT moving, and how it CAN deal damage ONLY when the tool is moving. I don't want to to be like the classic roblox sword.</p>
<p>I have this script here, I need to know what I can add to it that will allow the tool to deal damage ONLY ... | 122094 | 1 | 111220 | 0 | 528894344 | The_Saver31 | 257 | 2021-04-07 00:17:52 | <p>If you want a sword then, Here you go...</p>
<pre class='brush: lua'>local Tool = script.Parent
local Animation = Tool.Animation
local activeCooldown = false
local cooldownTime = 3
local Blade = script.Parent.Handle -- HitPart
local Damage = 10 -- Damage
Tool.Activated:Connect(function()
if (activeCooldown) then... |
0 | How was anti leave made in meepcity accident ? | 1093895530 | CharaIsCominUpForYou | 0 | 2021-02-22 17:15:13 | <p>Most of you possibly heard about MeepCity incident.While incident last there was anti leave function which didnt let you leave by roblox's leave button
Here's what im talking about https://streamable.com/02zpvr</p>
<p>I just wonder was it done by roblox scripting or by an external software</p>
| 120519 | ||||||||
0 | model:SetPrimaryPartCFrame() not working. What's wrong? | 102950718 | KrzysiekRoblox | 50 | 2020-05-09 10:26:45 | <p>Hello everyone :)</p>
<p>I'm making a replacement system in my game. When player will change his mind of replacing a model, he simply presses "q" button and model gets in its previous position... Well, here's the problem</p>
<p>When player presses the "Move" button, I immediately save model's CFrame in LocalScript's... | 102475 | 1 | 94655 | 1 | 9552668 | SteamG00B | 1633 | 2020-05-09 12:22:33 | <p>So this module script would go directly under your server script. I also took most of your old code and just copy and pasted it in and fixed some compatibility, so it should work the same, but if not let me know.</p>
<p>Server Script (the same one as your old one):</p>
<pre class="brush: lua">local module = require(... |
0 | Which script changes skybox in different areas? | 1683254402 | gta_12344567890 | 7 | 2020-07-12 17:29:56 | <p>Hello I wanted to know which script changes the sky in different areas,
for example: You enter an area changes the sky, but without changing it for other people.
if anyone knows I thank you very much.
but after it leaves the area it returns to normal, as if it were in space.</p>
| 108866 | ||||||||
1 | How do you create a roblox game that saves itself? | 30303601 | Toadboyblue | 67 | 2016-08-17 19:57:51 | <p>Hello,</p>
<p>Me and a buddy used to create maps on a personal build server, using F3X building tools, but now that personal build servers have gone kapoot, I was wondering if it's possible to create your own. I read about CreatePlaceAPI and SavePlaceAPI from <a target="_blank" href="http://wiki.roblox.com/index.php... | 34658 | 2 | 37274 | 0 | 3238120 | chrono2 | 189 | 2016-08-17 22:48:07 | <p>I don't know if it still works, but this could be exactly what you need!
https://www.roblox.com/games/74230852/PBS-Creator-NBC-Personal-Build-Servers</p>
|
0 | How to randomize StarterCharacter? | 554648856 | Lemonade9782 | 4 | 2022-09-13 18:57:41 | <p>To be more exact, how do I randomize my custom characters across players when a round starts, and how do I get their normal avatars back after the round is over?</p>
| 131613 | ||||||||
0 | How do we Clone all children and position then in a random spawn position in a folder? | 762271330 | Xx0966xX | 5 | 2020-07-07 00:39:01 | <pre class="brush: lua">local SpawnedGuns = game.Workspace.Gunspawned
local gunSpawns = game.Workspace.GunSpawns:GetChildren()
local gunsToSpawn = game.ServerStorage.Guns:GetChildren()
local CloneGuns = gunsToSpawn:Clone()
CloneGuns.Parent = SpawnedGuns
CloneGun.Position = math.Random("gunSpawns").Position
--But I don'... | 108393 | ||||||||
0 | How to fix touched event not firing???? | 1122312651 | totosimamora608 | 61 | 2021-09-11 06:18:58 | <p>so i want make a part if it touched a gui appears and i want to make so if a part touched the part transparency set to 0 but it didn't work</p>
<p>the Gui appears local script :</p>
<pre class="brush: lua">script.Parent.Touched:Connect(function(hit)
local char = hit.Parent
if char then
local player =... | 127361 | ||||||||
0 | How do I use StarterCharacterScripts? | 124774891 | Goodyere | 5 | 2016-05-23 01:02:06 | <pre class="brush: lua">I'm trying to learn how to use ROBLOX's StarterChearacterScripts, but I can't get any script I use to work. I've been using a LocalScript instead of a regular Script.
</pre>
<pre class='brush: lua'>-- This is a code I attempted, but failed. I'm new to StarterCharacterScripts, and could use a gre... | 30850 | 1 | 34116 | 1 | 1631699 | devSparkle | 84 | 2016-05-23 01:13:21 | <p>Most of the script above is unnecessary because of how <code>StarterCharacterScripts</code> works.</p>
<p>The basic concept behind <code>StarterCharacterScripts</code> is that any descendant of it will get parented to a player's character whenever it spawns. Subsequently, once the character dies, the script is destr... |
1 | Mouse keydown animation problem? | 2869366 | Paldi | 109 | 2014-10-17 15:16:36 | <p>I have a script to make my character do a animation when i click with the mouse button but it does the animation only when im walking or jumping, and not by clicking with the mouse.</p>
<p>ps: this is a local script in the StarterPack</p>
<pre class='brush: lua'>local player = script.Parent.Parent
local mouse = play... | 11739 | 1 | 14709 | 1 | 25455823 | YasuYoshida | 171 | 2014-10-17 16:13:53 | <p>You should use Button1Down not KeyDown. KeyDown is used for keyboard keys like : WASD. Button1Down is when you left click. Also you should have the script wait before the player loads, you might have problems in online mode without it.</p>
<p><a href="http://wiki.roblox.com/index.php?title=API:Class/Mouse/Button1Dow... |
1 | My script won't move when the value is true? | 169428835 | Cynical_Innovation | 595 | 2020-01-23 04:22:39 | <p>So when I set the Value to true the death sound still plays, meaning that the script did not see that the Value was true:</p>
<pre class='brush: lua'>local Position = Vector3.new()
local Monster1 = game.Workspace.Nightmare
local Monster2 = game.Workspace.Nightmare2
wait(25)
Monster1.Position = Vector3.new(4.366, 6.6... | 93444 | 1 | 86418 | 0 | 84828376 | PoppyandNeivaarecute | 134 | 2020-01-24 07:00:11 | <p>My best guess is to make it loop. Looking at the program it will only ever run once.</p>
|
0 | How do i make a x2 coins gamepass with this code? | 1026359604 | coolperson21216 | 4 | 2021-02-26 05:26:33 | <p>So i have been wondering how to make a x2 coins gamepass and i need help,
can i integrate a x2 coins gamepass with this code?</p>
<pre class='brush: lua'>waittime = 13 -- Time Between each hit
amnt = 10 --how much you get for it
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if (h~... | 120697 | 1 | 110005 | 0 | 55174990 | sO_Ov | 210 | 2021-02-26 16:12:27 | <p>I edited your code a little bit and this should work,
all you need to do is get your gamepass id and change it to 'GamePassId'</p>
<pre class='brush: lua'>local MPS = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local GamePassId = 15200883 -- your gamepass id here
local RespawnTim... |
0 | I can't get this simple script to work I'm such a noob? | 295595864 | 0msh | 333 | 2017-12-24 22:26:37 | <pre class='brush: lua'>script.Parent.MouseButton1Down:Connect(function()
local music = script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.LocalBackgroundMusic:WaitForChild("BGM")
if music.Volume > 0.7 then
music.Volume = 0
script.Parent.Text = "Unmute Music"
elseif music.Vol... | 50874 | ||||||||
1 | How to Get a Character From a Player()? | 148527490 | manith513 | 121 | 2020-04-11 19:53:09 | <p>Hello guys so I am sure a lot of you know the way GetPlayerFromCharacter() works its when you usually use an event that triggers the player's body in workspace and gets their player form in the players category I want to do the opposite I want to get the character from player and I don't really know how to do that h... | 98888 | 3 | 91364 | 1 | 459692218 | Nckripted | 580 | 2020-04-11 20:01:10 | <p>Get the character like this:</p>
<pre class="brush: lua">local char = workspace:FindFirstChild(player.Name)
</pre>
<p>Hope this helped.</p>
|
0 | How to check if multiple parts have the same value? | 480702536 | cancle5 | 105 | 2021-05-01 11:36:09 | <p>Basically, I have 5 parts and in each part there's a value.
Who can i check if all the values are the same.</p>
<p>I didnt want to do a for i, v in pairs since i wanted to do it all at once. Yes all the parts are the same</p>
| 122987 | 1 | 112068 | 1 | 104460157 | sydre | 214 | 2021-05-01 13:09:30 | <pre class='brush: lua'>if part1.valueName.Value == part2.valueName.Value and part2.valueName.Value == part3.valueName.Value and part3.valueName.Value == part4.valueName.Value and part4.valueName.Value == part5.valueName.Value then
-- Your code here
end
</pre>
<p>Not sure why you wouldn't want to use an in pairs lo... |
0 | Help on importing player's avatar into the game only visible to that character? | 686748923 | TheBlurryKnight | 10 | 2021-02-07 19:53:36 | <p>I have a crucial part in my roblox horror game where the player see him/herself lying dead on the floor but due to the way the game is structured i need this to be only visible to that specific player so that if another player (say player b) is next to him, they would not see player a 's avatar, they would see there... | 119785 | ||||||||
0 | <error-type> error that appears when trying to script a mob NPC? | 1961959172 | imnotaguest1121 | 362 | 2022-08-07 14:29:51 | <p>Hello!</p>
<p>I am making an NPC that when parented In workspace, It will create a small mob, the problem Is that where Is a Issue when doing a pathfinding script for the other mobs, the Waypoints said: "<error-type> I am currently new to this type of error</p>
<p>Script</p>
<pre class="brush: lua">local COPER = ... | 131129 | ||||||||
0 | Help with players spazzing out when hitting objects while flying using flight script? | 81102736 | NotoriousCrimson | 0 | 2021-09-14 05:06:33 | <p>I am currently working on a DBZ roleplaying game, and the flight script is a bit funky, in the terms that when a player hits an object they will spin out of control and it ruins the effect, i have no idea what i am doing and im mostly just watching youtube tutorials and typing it out into my game. if there is any wa... | 127430 | ||||||||
2 | My sprint script not changing animation! How to fix? | 1044984225 | datboyPiter | 52 | 2021-04-21 08:19:58 | <p>Hello i have some problems with my sprinting script because it doesn't change the animation from walking to running and only works when i stop and start moving again</p>
<pre class='brush: lua'>local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Cam = workspace.Camera
local NormalSpeed = 16... | 122622 | 2 | 111764 | 0 | 104275128 | PurpleSouley1234 | 43 | 2021-04-21 21:39:19 | <p>This should fix it, but you have to change both of your animation's priorities to "Movement" and toggle looping for both of the animations that should fix everything.</p>
<pre class='brush: lua'>local player = game.Players.LocalPlayer--The local player variable
local Camera = workspace.Camera--The camera variable
lo... |
0 | Problem with for i,v in pairs returning a number? | 8189014 | dirk29 | 0 | 2014-11-29 06:59:39 | <p>I have this function towards the top of my script.</p>
<p>function maps()
for i,v in ipairs(game.Lighting.Maps:GetChildren()) do
wait(1)
return i
end
end</p>
<p>I currently have a group in Lighting called 'Maps'. I have 2 maps in the Map group.</p>
<p>A little way down the script I have this now,</p>
<pre class="bru... | 12841 | ||||||||
1 | what does the word inside the function brackets mean? | 149534749 | WeaponisedPenguins | 97 | 2021-07-29 09:23:29 | <p>Could someone please give me a semi-detailed explanation on what the words mean inside the function brackets?</p>
<pre class='brush: lua'>function( this word here )
</pre>
| 125840 | 1 | 114503 | 2 | 85341864 | JustinWe12 | 723 | 2021-07-29 12:15:05 | <p>It is a parameter and there can be multiple of them seperated by a "," (Comma). It acts like a variable and can hold a value. When calling the function, you can send in an argument for the parameter.</p>
<pre class='brush: lua'>local function SayThis(WhatToSay) -- WhatToSay would have a value of Hello because it was... |
0 | How can I make the Explosion apear on the block? | 564047533 | GameGuy300K | 4 | 2023-03-09 22:17:36 | <p>I wanted to make it that when an Object with an specific name (in this case BallBall) will touch the Part with the script in it, the Part with the script will explode. But I can not get the right possition of the Explosion. I want the explosion to happen inside or ontop of the Part with the script in it. btw I dont... | 133168 | 1 | 120245 | 0 | 1961959172 | imnotaguest1121 | 362 | 2023-03-09 23:43:26 | <p>In Line 6 you typed: <code>explosion.parent = script.parent.CFrame</code> and not <code>explosion.Position = script.parent.Position</code>. Also, you want it to explode infinity? make sure you use <code>while wait(0.2) do</code></p>
<pre class='brush: lua'>script.Parent.Touched:Connect(function(Part)
if Part.Nam... |
1 | Displaying User Input | 28187465 | Nytroz | 15 | 2014-02-18 12:48:05 | <p>So, I have a Setup GUI. When the user clicks confirm I want that data to be stored somewhere so they can be displayed at a later stage.</p>
<p>So the GUI http://prntscr.com/2tlgq1 will take the user input from Team Name and display it in the next GUI http://prntscr.com/2tlh62. My question is "How will I go about doi... | 59 | ||||||||
1 | Why Is my forcefield GUI not placing forcefield on the player? | 1961959172 | imnotaguest1121 | 89 | 2021-12-21 23:17:04 | <p>Ello fellow robloxains! I have appear to come Into a problem when making a GUI as the name suggest Its a simple GUI button that makes a forcefield when you press It however It doesn't spawn on the player rather Instead In the middle of the baseplate how can I overcome this problem?</p>
<p>Script:</p>
<pre class='bru... | 128372 | ||||||||
0 | invalid argument #1 to 'new' (Color3 expected, got BrickColor)?????? | 1304881502 | AvocadoM678 | 17 | 2022-05-04 19:34:27 | <p>i want to make it so that the script will get the color of what the dummy is before it changes color but it says this is invalid help me i want to make a ice scythe</p>
<pre class='brush: lua'>Handle.Touched:Connect(function(bit)
if bit.Parent:FindFirstChild("Humanoid") and bit.Parent ~= Tool.Parent then
... | 129910 | ||||||||
0 | How Do You Fix Function Firing Twice Or More? | 161950547 | Minecrafter09031031 | 16 | 2020-07-31 07:26:26 | <p>Hello, I been Trying to make a NeonParty Or something like that</p>
<p>-- The Code --</p>
<pre class='brush: lua'>local ClickDetector = script.Parent.ClickDetector
local Debounce = script.Parent.Parent.Debounce
local NeonParts = game.Workspace.NeonParts
local Tween = game:GetService("TweenService")
local Info = Twee... | 110369 | 1 | 101395 | 0 | 1522202318 | NathanBlox_Studios | 212 | 2020-07-31 09:43:38 | <p>Do not make debounced an external value, create a variable in the script e.g local db = false, unless you are using it for more scripts</p>
<p>If that does not work add a wait function</p>
|
0 | Remote Events and Remote Functions? | 5820674 | woodengop | 1134 | 2015-05-03 07:13:12 | <p>One of my Questions are, How do you set up and Fire a RemoteEvent/RemoteFunction?</p>
| 17235 | ||||||||
0 | Well, need help with Player Points and Developer Products? | 7346284 | Asirix | 15 | 2014-04-30 23:48:20 | <p>Okay, I am trying to make a player points store, original, yes I know. I'm broke though so, aha.
I'm trying to have it where when you click the button, it brings up the purchase, then rewards points after the points are purchased.</p>
<p>Could you help me with the code? Here is on for the script:</p>
<pre class='bru... | 4024 | ||||||||
0 | How do I weld a sword to my hand? (Not Mesh, but multiple parts) | 563111237 | qMrSpooky | 18 | 2021-05-02 17:01:14 | <p>So I'm making a game and I have different classes, but I can't seem to Weld a Group of parts (Or parts that are inside another part) to my Right and Left hand, cause that is the only way for me to make a Dual Wield
I have tried using qPerfection's Weld Script, but that seems to dissapear if I put the character as a ... | 123035 | ||||||||
1 | Placement System Will Not Work Currectly When InvokedServer?? | 266723646 | AIetheo | 236 | 2017-11-05 18:32:27 | <p>I made this placement system but it will not work.</p>
<p>LocalScript Inside of StarterPack:</p>
<pre class='brush: lua'>local Player = game.Players.LocalPlayer
local Base = Player:WaitForChild("base")
local Money = Player:WaitForChild("Money")
local UIS = game:GetService("UserInputService")
local Mouse = Player:Get... | 49188 | 2 | 49321 | 1 | 14601325 | KidTech101 | 376 | 2017-11-05 18:53:28 | <p>You're going to run into a few errors, and you're going to have to revise your scripts.</p>
<p>The error you are getting right now is caused by line 6 of your server side script. In it, you write <code>local Plr = game.Players[Player]</code>, where <code>Player</code> is a <code>Player Object</code> and not a string... |
0 | Content expected, got nil error. Help? | 1927949063 | Chardino23 | 0 | 2022-07-23 12:29:32 | <p>So, I'm following a tutorial on how to make a Find The game, and I was doing the GUI for the "Nice! You found whatever!" thingy.</p>
<p>But when I try collecting the thing I made to see if the GUI works, I get this error instead.
"Unable to assign property value Image. Content expected, got nil."</p>
<p>Here's the c... | 130904 | ||||||||
0 | Why is my for in pairs() loop not running? (script includes pathfinding) | 1272029006 | Gmorcad12345 | 15 | 2020-09-14 11:51:18 | <p>Hello.
I am trying to use PathfindingService to create a path for an NPC to walk when a player touches a part. At line 45 of the code (the one that says for _, in pairs()) , the for loop doesn't run. I think that's the case since the print() statement at line 47 wasn't printed.</p>
<p>the script goes like so: when t... | 113156 | ||||||||
2 | Can hackers mess with their own Character? | 2479393 | Dfzoz | 345 | 2020-01-16 04:46:31 | <p>I discovered that if I delete objects like bodyparts from my character or change my Walkspeed locally the effects also applies serverside. Does that mean that a hacker can still hack speed jump and noclip (adding notouchconstraints) on my game?</p>
| 93094 | 1 | 86127 | 2 | 14673497 | aquathorn321 | 858 | 2020-01-16 10:11:17 | <p>I'm not sure about the extent to which the client can modify their character, but the client does have network ownership over their character. Roblox doesn't come with any sort of native anti-cheat, so even if all of your scripts and remote events/functions are secure you still have to track player movement to check... |
0 | How do you put an imagelabel BEHIND something? | 17820096 | jblade73 | 3 | 2014-04-20 15:14:28 | <p>I have a Imagelabel I want it behind another image but its in front .. How do I make it behind?</p>
| 2995 | ||||||||
0 | How do I regenerate a map? | 47229692 | DisguisedKairos | 0 | 2014-04-17 09:19:17 | <p>Does anyone know how to regenerate?</p>
| 2405 | ||||||||
0 | How to correctly write the code for teleporting zombies in different parts of the map? | 544677859 | rikisamejima | 9 | 2020-11-23 16:08:31 | <pre class='brush: lua'>function low_zombie1()
local platform = game.ReplicatedStorage.MapOne.ZombieSpawn
local sizeX = math.floor(platform.Size.X / 2)
local sizeZ = math.floor(platform.Size.Z / 2)
local sizeY = math.floor(platform.Size.Y / 2)
local x = math.random(-sizeX, sizeX)
local z = math.... | 116207 | ||||||||
0 | Strange error? "bad argument #1 to 'pairs' (table expected, got number)" | 7592949 | Abandion | 118 | 2020-04-05 03:35:58 | <pre class='brush: lua'>elements = {
ElemA = 1,
ElemB = 2,
ElemC = 3,
Wood = 4,
Metal = 5,
}
function elements:bynum(self, num)
for i, v in pairs(self) do
if num == v then return i end
end
end
</pre>
<p>bad argument #1 to 'pairs' (table expected, got number)
stack traceback:</p>
| 98156 | 1 | 90635 | 2 | 1159375735 | NightmaareTsukuyomi | 78 | 2020-04-05 03:37:24 | <p>You do not need the "self" in the functions parameters</p>
|
3 | Why does the '#' act like comments '--'? | 17514438 | TheeDeathCaster | 2319 | 2014-11-04 22:20:57 | <p>I was looking at a few scripts 'in studio', and I stumbled upon this type of code that kind of acted as a <a target="_blank" href="http://wiki.roblox.com/index.php?title=Comment_(Scripting)">comment.</a> But it has a red line under it, why does the <code>#</code> act as a comment? Here's an example of how it's used;... | 12205 | ||||||||
0 | Why does it keep on breaking the loop even though its false? | 171340748 | maxpax2009 | 335 | 2020-05-15 17:32:18 | <p>So i made a loading text screenGUI, but it does not function correctly?</p>
<pre class='brush: lua'>local highest = 4
local CanBegin = false
if game.ReplicatedStorage.IsReadyFinished == true then
while true do
wait(2)
local Texts = {
".",
"..",
"..."}
for i, v in pairs(Texts) do
scrip... | 103238 | 2 | 95311 | 6 | 62087109 | Raccoonyz | 893 | 2020-05-15 17:52:40 | <p>.Value</p>
|
1 | Why is my purchase system not working? | 96185281 | Dr_Luxxe | 5 | 2021-05-03 20:48:11 | <p>The goal of this is to determine what product the person buys, and how many seconds it corresponds to in the table. Currently, it prints nil.</p>
<p>Script in ServerScriptService:</p>
<pre class='brush: lua'>local PaymentTable = {
['1167769246'] = 1,
['1167769541'] = 55,
['1167769540'] = 10,
['116776... | 123064 | ||||||||
2 | Equal sign is red and I don't know what to do? | 44275045 | higzl | 17 | 2017-05-17 21:41:52 | <pre class='brush: lua'>if script.Parent.Parent.Door.CanCollide = true then
</pre>
<p>It shows that = is red, I don't get it and I need help with it.</p>
| 42992 | 1 | 44491 | 4 | 38036947 | marioblast1244 | 113 | 2017-05-17 21:44:13 | <p>When you are making an <code>if</code> statement and want an equal condition, then you would have to use <code>==</code>. For example:</p>
<pre class='brush: lua'>if script.Parent.Parent.Door.CanCollide == true then
</pre>
|
0 | How to change the key? | 81482246 | Conmmander | 479 | 2016-03-04 18:24:43 | <p>I created this script following some instructions but I am not sure how I would change it so that if the F key is hit you sprint but if the F key is hit again you stop sprinting. I also would like an explanation as to how this script exactly works as I see this string stuff and and I am not sure what it even does.</... | 28116 | 1 | 31582 | 4 | 2155311 | EgoMoose | 802 | 2016-03-04 19:43:04 | <p>My first suggestion would be to use the UserInputService since KeyDown and KeyUp are deprecated methods of getting user input.</p>
<p>With that in mind there are two events we need in the UserInputService:</p>
<p>http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan
http://wiki.roblox.com/inde... |
0 | player.userID = game.CreatorID then? | 14912988 | casperfox | 0 | 2017-10-16 00:36:19 | <p>So i am learning how to script and i look through free models to learn.. When looking through this free model, i dont understand how it works..</p>
<pre class='brush: lua'>function OnPlayerEntered(player)
if player.userId == game.CreatorId then --What does this mean?
local msg = Instance.new("Message")
... | 48686 | ||||||||
0 | How do I return the full BrickColor Pallete? [SOLVED] | 50955067 | funzrey | 58 | 2015-08-14 22:02:10 | <p>I'm working on a painting tool since currently with roblox's new pallete it broke the old paint tools, and people are starting to annoy me about my game, I'm working on the color picker GUI but I dont want to spend the time making all of the buttons for BrickColors, How do I return the whole pallete and put the butt... | 21400 | 1 | 25007 | 1 | 386992 | BlueTaslem | 18071 | 2015-08-14 23:10:26 | <p>If you print out some things from <code>BrickColor.palette</code>, you'll notice they're in the same order as the hexagon palette used by Studio:</p>
<pre class='brush: lua'>print( BrickColor.palette(0) ) -- Earth green, top left
print( BrickColor.palette(6) ) -- Navy blue, top right
</pre>
<p>That means the hex is ... |
0 | Why is there the error,"Unknown global" when I spelled something right? | 60589287 | VCRaygamma | 15 | 2015-05-03 21:25:17 | <p>Ok so I'm trying to make this rain cloud script and put a script inside. Look at this block of code</p>
<pre class="brush: lua">while wait(25) do
game.Workspace.Raincloudpart.Transparency = 1
game.Workspace.Raincloudpart.ParticleEmitter.Enabled = false
wait(0)
game.Workspace.Raincloudpart.Transparenc... | 17253 | ||||||||
0 | How do I correctly use the Hit function? | 13382656 | Lightdrago | 95 | 2014-08-24 12:49:25 | <p>I now know that I could use the <code>Hit</code> function to execute a script when the part is hit by an explosion. I just don't know <em>how</em> to do that. I was wondering if I could get more help on this issue. I would love for you guys to help! <strong>Thanks!</strong></p>
| 10163 | ||||||||
0 | How to put variables in strings? | 22645404 | AtomicChocolate | 35 | 2016-05-28 01:23:46 | <p>I am not exactly sure how to do this. So my code is:
script.Parent.ResponseDialog = "You have clicked me times"
and in between "me" and "times" I want to put a variable in there, but how do I do so?</p>
| 31013 | ||||||||
0 | ImageLabel does not change position on DialogChoiceSelected [?] | 524832183 | nikitos54327 | 70 | 2023-03-12 07:36:48 | <p>Hey scripters!</p>
<p>I was doing a script so if a player chooses the wrong DialogChoice he would die and get a SHAKING jumpscare (shaking is the keyword)</p>
<p>Here is the script:</p>
<pre class='brush: lua'>dialog = script.Parent
local loleris = script.Parent.Popup:WaitForChild("ImageLabel")
oldpos = loleris.Posi... | 133182 | ||||||||
0 | Any help w/ getting teleported to a part? | 27621739 | FiredDusk | 1466 | 2015-04-29 21:58:20 | <p>This script is inside a part.
When you touch it, it will bring you to those cords in the script. But it takes everyone in the game w/ you to the part at the cords.</p>
<pre class='brush: lua'>function lol()
local player = game.Players:GetPlayers()
for i = 1, #player do
player[i].Character:MoveTo(Vector3.new(... | 17121 | ||||||||
0 | My Tools Break after being cloned what's causing this? | 203253723 | xxXDuckzzXxx | 15 | 2022-11-13 07:16:48 | <p>I set up a basic shop system so you can buy guns off a terrible looking menu. but for some reason when the gun is cloned all the scripts break any idea what the problem is?</p>
<p>Script:</p>
<pre class='brush: lua'>local weapon = game.Workspace.C7A2
local plr = game.Players.LocalPlayer
local sus = plr:WaitForChild(... | 132263 | ||||||||
0 | MapVoter not work, bad argument #2 to 'random' (number expected, got table)? | 34068239 | NiniBlackJackQc | 1491 | 2018-04-05 15:53:59 | <p>I want random choose three maps for player voting but I don't know how scripting that and I get errors.. So somebody can help me?</p>
<blockquote>
<p>Workspace.GameScript:227: bad argument #2 to 'random' (number expected, got table)</p>
</blockquote>
<pre class='brush: lua'> local Maps = {}
local AllMaps = RS... | 56257 | 2 | 55007 | 3 | 312047434 | ReadyHappiness | 109 | 2018-04-05 16:01:16 | <p><strong>PROBLEM #1</strong></p>
<p>On line 5 of your script, you're telling the function <code>math.random()</code> to choose a number between 1 and a table of all your maps. You're telling the function to choose a number between a number and table. This will result in an error, because the function expects both <em... |
0 | Studio always crashes,I don't know how to do a different technique? | 22502080 | lolkid007 | 43 | 2018-04-17 14:30:44 | <p>When I click, studio either wants me to break/kill the script or it just crashes. I don't know how to do the same script with a different technique, but the loop inside of a loop is not working. Here's script:</p>
<pre class='brush: lua'>loop = 1
local CD = script.Parent -- Clickdetector
while true do
while loop... | 56993 | 3 | 55705 | 0 | 264859050 | Nonaz_jr | 439 | 2018-04-17 19:13:43 | <p>The reason your script crashes is because you end up in an infinite loop without any wait statements in it. Let's walk through your script.</p>
<pre class='brush: lua'><br />loop = 1
local CD = script.Parent -- Clickdetector
while true do
while loop < 8 do
</pre>
<p>so far all is good, a double loop is no pro... |
0 | How do you convert HSV to RGB like that of toHSV? | 143096970 | Rayguyban2 | 89 | 2021-05-18 23:02:01 | <p>So I need to convert HSV to RGB for a color picker I am making from scratch though the problem is that I don't know how to. I know of toHSV but there is not toRGB so I don't know what to do</p>
<pre class='brush: lua'>local ColorOfHSV = Color3.fromHSV(0.6, 0.8, 1)
-- What to do to convert it to RGB?
</pre>
| 123574 | ||||||||
0 | How can I make a gun work in a bird's eye view? | 83827805 | KingDomas | 153 | 2023-02-17 13:52:22 | <p>I'm making a game where you are in a bird's eye view (<a target="_blank" href="https://imgur.com/a/K8dC05h">image</a>). In this game, you are supposed to be able to shoot weapons. However, I'm struggling to get this core concept down, as I'm not sure how to create a gun script which works in this fashion. I have a g... | 133084 | ||||||||
0 | How come the playermouse is nil in serverscript but not in localscript? | 31504923 | rabbi99 | 632 | 2020-03-28 17:27:24 | <p>Down here is my localscript.
If I were to run this script in local script, it would print out 'instance'</p>
<pre class='brush: lua'>player = game.Players.LocalPlayer
character = player.Character
mouse = player:GetMouse()
team = player.Team
hit = mouse.Hit
print(mouse)
local ReplicatedStorage = game:GetService("Repl... | 97346 | 4 | 89920 | 0 | 104460157 | sydre | 214 | 2020-03-28 17:35:42 | <p>The player:GetMouse() event only works in local scripts. Doesn't matter if you try to parse it to a server script through a remote event, it won't work</p>
|
0 | I need help with a Toggle Visibility script? SOLVED | 7346284 | Asirix | 15 | 2014-05-01 01:33:50 | <p>So, I really have no clue at this point. I was told to you elseif instead of if in the 4 fourth line.
Well... it didn't work. SO, I guess I need some help.</p>
<p>Here it is:</p>
<pre class='brush: lua'>script.parent.MouseButton1Click:connect(function(Open)
if game.StarterGui.ExploreID.ProfileShade.Visible==fals... | 4038 | ||||||||
0 | Check for boolvalue to unlock a door not working? | 491947921 | bblossomedd | 2 | 2022-11-18 21:50:29 | <p>My code is a followup to a basic admin command I made. Chefs can use a !unlock command with the argument being user, and it will remove a forcefield for the player. What I have done so far is making a script that gives each player a boolvalue titled "forcefield" when they join that is automatically set to true. The ... | 132310 | ||||||||
0 | How to fix an audio glitch with my script? | 16504446 | alaingomez100 | 0 | 2015-04-09 03:30:36 | <p>This script is a music script I use , but if I'm in the game and someone else joins while the 2nd song is playing they hear the first song playing at the same time as the 2nd song is playing . How do I fix this?</p>
<pre class="brush: lua">ID = 'SONG1'
Music=Instance.new("Sound" ,Workspace)
Music.Name = "Music"
Musi... | 16521 | ||||||||
3 | Is this the proper way to make your Game BodyType compatible? | 74087102 | Ziffixture | 6785 | 2018-12-20 23:43:04 | <p>This is what I read, I made it slightly more efficient though, I'm pretty sure this is how people use it? I've never worked with BodyTypes before, I may be completely wrong, so don't judge, either that or the source I read from is horribly wrong.</p>
<p>I'd also like to know if it's necessary to also include Rthro?<... | 72641 | ||||||||
0 | Get the rest of the players | 15651493 | markus6 | 5 | 2014-03-23 16:59:12 | <pre class='brush: lua'>local rp = gt[math.random(1,#gt)]
</pre>
<p>So now i have the random player, but how do i get the rest of them?
I want everyone else than the random player</p>
| 870 | 2 | 1335 | 2 | 53627646 | modFrost | 130 | 2014-03-23 17:11:55 | <p>If you want everyone other then 1 player it would be somewhat like this,</p>
<pre class='brush: lua'>for _,Player in pairs(gt) do -- For all the players
if not Player == rp then -- If player is not the randomly selected player
--Etc.
end
end
</pre>
<p>or if you wanted them to be in a table,</p>
<pre ... |
0 | Get all the values of a table? | 13281954 | Mitko0o1 | 4 | 2015-02-03 14:12:09 | <p>I am apparently a beginner with the table functions and I want to know if there is a method to get all the values of a table and change their properties. This is the script:</p>
<pre class="brush: lua">tablepart = {} -- my table
function parts()
local parts = script.Parent:GetChildren() -- creates a table with the c... | 14718 | 2 | 17775 | 0 | 386992 | BlueTaslem | 18071 | 2015-02-03 19:45:09 | <p>There isn't exactly. The simple way to fix your set up is to lift the <code>wait</code> out:</p>
<pre class="brush: lua">repeat
wait(1)
for i = 1, #tablepart do
tablepart[i].Transparency = tablepart[i].Transparency + 0.1
end
until tablepart[1].Transparency >= 0.5
</pre>
<hr/>
<p>We actually <e... |
0 | Why my checkpoint system is just teleporting me to the stages? | 1850403883 | yuni_Boy1234 | 320 | 2020-10-07 17:54:59 | <p>I am trying to make an obby that uses checkpoints and saves the data, i have tested it with my friends but it only teleports me to the stage i left. Help please.</p>
<p>Server Script:</p>
<pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
re... | 114108 | ||||||||
0 | How to disable player movement? | 926536458 | theepicboy6789 | 56 | 2020-05-10 07:26:47 | <p>I've tried looking all over the dev forum for a script to disable player movement, I've found a few but I don't know where to put it? Anyone know where I'm supposed to put it, you can give me a totally different script, I just want to know where you're supposed to put it!</p>
| 102568 | 1 | 94721 | 0 | 443615303 | Filip100012 | 58 | 2020-05-10 07:40:32 | <p>So I made this script</p>
<pre class="brush: lua">workspace.ChildAdded:Connect(function(plr)
if plr:FindFirstChild("Humanoid") then
plr.Humanoid.WalkSpeed = 0
end
workspace.Gravity = 1797693134862315708145274237317043567980705675258449965989174768031572607800285387605895586327668781715404589535143824... |
0 | How do I rotate an object on one axis? | 116748962 | WyattDevv | 29 | 2023-03-03 07:35:53 | <p>So I have been making this Dead Space Plasma Cutter type thingy and I ran into this issue where I have been trying to rotate the blades of the gun on one axis while all the other axis' aren't affected (or actually rotate). I don't know how to make this work so any and all help will be largely appreciated.</p>
<p>All... | 133136 | 1 | 120227 | 1 | 116748962 | WyattDevv | 29 | 2023-03-03 08:17:30 | <p>Welp, I figured it out! All I did was change the hierarchy a bit to have another part basically holding the position of the blades. Then I changed the code to this:</p>
<pre class='brush: lua'>-- Creating a new Moter6D joint to rotate the blades on one axis
local bladeJoint = Instance.new("Motor6D")
bladeJoint.Part0... |
0 | How to make a text that looks like it's typing? | 1792778813 | Xapelize | 2326 | 2019-09-21 05:56:56 | <h1>Please note this is a old post, so the time when I posted this I was a young kid, please don't complain</h1>
<p>So, I wanted to make a text that repeatedly gain word by word instead of replacing the whole text as the text. Is there any solutions?</p>
| 87730 | 1 | 81291 | 0 | 532084574 | AnasBahauddin1978 | 715 | 2019-09-21 06:34:04 | <p>insert a gui, a frame and put a LocalScript inside the frame then type</p>
<pre class='brush: lua'>local text = "Your Text"
for i = 1, #text do
game.StarterGui.YourGui.Frame.TextLabel.Text = string.sub(text, 1, i)
wait() -- The more the number, the slower the typing
end
</pre>
|
0 | Can you make a part move using WASD? | 147087960 | Yutube_SB101 | 5 | 2018-02-04 20:32:54 | <p>In the game, I'm trying to make it so that when you sit in a certain seat a GUI will pop up and some controls. I know how to do that, but when you select the part you want to move in the GUI I'm not sure how to make the player be able to move the part using WASD. I was thinking about using Key-down and C frame, But ... | 53175 | 1 | 52471 | 0 | 22825007 | ultrasonicboomer | 85 | 2018-02-05 01:51:47 | <p>Increase the CFrame by 1 depending on which dimension you're increasing, so it'd end up like:</p>
<pre class='brush: lua'>function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.W then
part.CFrame = part.CFrame + Vector3.new(x,y,z) -- if increasing x by 1 it would be 1,0,0 and so... |
0 | Check if a player is in first person? | 24090816 | CodeSponge | 125 | 2015-06-06 18:38:21 | <p>How can I check if a player is in first person?</p>
<p>[I do not need a first person lock. I need to check if the player is in first person.]</p>
| 18221 | 1 | 21695 | 1 | 35339312 | ImageLabel | 1541 | 2015-06-06 18:48:57 | <p>I assume you already know how to set a player's <strong>CameraMode</strong> to first person.</p>
<pre class="brush: lua">player = game:GetService('Players').LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson
</pre>
<p>All you would have to do to check would be to check if the CameraMode is set to <code>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.