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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | How do i optimize my entity system? | 460847762 | mooserescue999 | 0 | 2022-09-15 23:27:09 | <p>I've made this entity system for a game I'm making,
and it hold around 300-600 enemies before lagging anyone know how to optimize it more (the enemies are on client server sends client position to update it)</p>
<p>server:</p>
<pre class='brush: lua'>local mob = {}
local ReplicatedStorage = game:GetService("Replicat... | 131632 | ||||||||
1 | FindFirstChild is not a valid member of workspace error for no reason? | 206639588 | fifayy | 16 | 2020-06-09 01:06:35 | <p>I was looking at a Region3 roblox scripting tutorial and when i was tryping the script i finished it then i clicked play it show the error of "FindFirstChild is not a valid member of workspace".</p>
<p>Here is my script</p>
<pre class='brush: lua'>local region = Region3.new(Vector3.new(5,0,5), Vector3.new(15,15,15))... | 105816 | ||||||||
1 | Why won't this script find the player's character? | 3238120 | chrono2 | 189 | 2016-08-18 18:33:57 | <p>Assuming p ends up ultimately becoming the player, why won't this script find the appropriate player's character and do the appropriate effects to them?</p>
<pre class="brush: lua"> func = function( p ) -- functions go HERE
print(p.Name .. " GOT REKT")
local playername = p.Name
loc... | 34709 | ||||||||
0 | Script I've been trying to figure out for about 3 hours. Camera works in Studio? | 9297123 | Qorm | 100 | 2015-02-01 21:55:49 | <p>OK. So here's what's making me very frustrated; I made a few scripts, so the camera locks on to a position and target . That works! Ok. My problem is, when I try to disable it from my teleporter script, the camera breaks and doesn't change subjects or target. <strong>Here's the Camera script</strong>:</p>
<pre class... | 14675 | ||||||||
1 | Storing more than two values in a datastore? | 42389829 | stepatron | 103 | 2018-06-17 20:46:46 | <p>Is it possible to do something like?</p>
<pre class='brush: lua'>datastore:SetAsync(player.userId, false, 420)
</pre>
<p>If not, how would I be able to?</p>
| 60581 | 2 | 58941 | 6 | 89430243 | Amiaa16 | 3227 | 2018-06-17 20:51:52 | <p>You can store a table in the DataStore.</p>
<p>If you haven't used tables yet, learn more about them <a target="_blank" href="http://wiki.roblox.com/index.php/Table">here</a></p>
<p>You would do it like this:</p>
<pre class='brush: lua'>datastore:SetAsync(plr.UserId, {false, 420})
</pre>
|
1 | How do I delete the tool that the player is holding ONLY? | 1884026220 | OneHit_Point | 5 | 2021-09-19 20:17:49 | <p>I've tried a lot of scripts, but none work. I would like to know to how to only delete the tool that the player is holding, not any tools in the backpack though</p>
| 127562 | ||||||||
1 | random Player teleporter teleporting all players? | 147996688 | mistermaster06 | 3 | 2020-09-13 21:25:21 | <p>Hello, at one point in my game I need 1 player to be teleported to a specific position in the game. However, instead of one player, all players are being teleported and I am not sure why. The script is located in ServerScriptService. I have done a lot of research and cannot find an answer!.</p>
<p>Code:</p>
<pre cla... | 113134 | 1 | 103873 | 0 | 158811 | TGazza | 210 | 2020-09-14 05:36:40 | <p>The problem is on line 7</p>
<pre class='brush: lua'>for _, plr in pairs(game:GetService("Players"):GetPlayers(RandomPlayer())) do
</pre>
<p>this wont work and will return All players not just the selected player.
I've re-written the code so it will work with only 1 player and teleports them to your cave wp</p>
<p>C... |
1 | it print 1 and print 2 but why it happan? | 709424487 | Trorapantest1 | 13 | 2021-05-01 03:48:49 | <pre class='brush: lua'>local Button = script.Parent.Button
local Green = script.Parent.Green
local Red = script.Parent.Red
local LightHolo = script.Parent.Light
local ClickDetector = script.Parent.Button:WaitForChild("ClickDetector")
local debouce = true
function off()
if debouce == false then
Button.CFram... | 122981 | 2 | 112059 | 1 | 94006350 | BulletproofVast | 370 | 2021-05-01 04:49:37 | <p>i think its cos when debounce is true, it makes it false so when it moves to the next line it will show as false and change to true again.</p>
<p>try adding a return after like this i gues</p>
<pre class='brush: lua'>ClickDetector.MouseClick:Connect(function()
if debouce == true then
on()
return
... |
2 | Character Editing | 29806839 | ConnorVIII | 448 | 2014-03-24 17:50:51 | <p>I am trying to make a script that removes a players CharacterMeshes,Hats and Body Colors when he enters and spawns.</p>
<p>I am a terrible scripter but I tried to write it.</p>
<pre class='brush: lua'>game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
char... | 885 | 3 | 1357 | 5 | 29251132 | HexC3D | 830 | 2014-03-24 18:20:14 | <pre class='brush: lua'> game.Players.PlayerAdded:connect(function(player)
player. CanLoadCharacterAppearance = false
end)
</pre>
<p><code>CanLoadCharacterAppearance</code> is property of a player which allows the player's appearance to be loaded or not.</p>
|
0 | How to get the face of a touched part as a NormalId or Vector3 orientation? | 1007890826 | nc2r | 117 | 2019-09-27 21:32:22 | <p>A NormalId is an enum for the 6 faces of a cube. Suppose I have a part that is triggered by a touched event. This script is in a projectile</p>
<pre class="brush: lua">script.Parent.Touched:Connect(function(Hit)
--How to return a NormalId corrosponding to the face that was hit?
--OR
--How to return a Vector3 corrosp... | 88016 | ||||||||
0 | How to count studs infront of the humanoid? | 147305218 | PeterParker17386 | 16 | 2022-10-28 12:29:38 | <p>Im making a game that allows you to say a weapon and it will appear. I want to make it so a wall will appear a few studs away from the player when they say "wall". I am trying to make the wall appear a few studs in front of the HumanoidRootPart. Here is my script:</p>
<pre class='brush: lua'>local CallMsg = "wall"
l... | 132061 | 2 | 119275 | 0 | 472504641 | AlexanderYar | 788 | 2022-10-28 20:40:12 | <p>Relative, you say? The answer is lookvector.
<a target="_blank" href="https://create.roblox.com/docs/reference/engine/datatypes/CFrame">CFrame roblox documentation</a></p>
<p>If you dont know, its part of CFrame. CFrame is a property ALL "BaseParts" have. CFrame is just physical data like Location and ROtation and s... |
1 | I want to make script for tool when equipped disables some scripts in StarterCharacterScripts? | 1451125842 | KarsAwaken | 5 | 2022-09-16 09:13:15 | <p>local Tool = script.Parent
local Start = game.StarterGui
local found = game.StarterPlayer.StarterCharacterScripts("Punch")</p>
<p>function onEquippedLocal()
Start:FindFirstChild("ShiftToSprint").Disabled = true
end
function onUnequippedLocal()
Start:FindFirstChild("ShiftToSprint").Disabled = false
end</p>
<p>Tool.Eq... | 131637 | ||||||||
0 | How do I make a chair that can spin around like real gaming chairs? | 676326715 | WINDOWS10XPRO | 134 | 2021-01-09 05:44:53 | <p>How do I make a chair that can spin around like real gaming chairs?
basically I want the script to check if the player sit on the chair, else the script won't run and if the player sit on the chair, they can only use a and d. a to spin the chair to the left and d to spin the chair to the right. Hope this can make yo... | 118438 | ||||||||
0 | Whats wrong with this if health, display gui? [not working] | 580873191 | khubzeater | 0 | 2018-04-20 14:37:18 | <pre class='brush: lua'>if workspace.CreatureA.Humanoid.Health == 0 then
game.StarterGui.ScreenGui.Enabled = true
end
</pre>
<p>I tried making a script that displays a gui when creatureA's health is zero but it didn't work</p>
<p>note: In the actual code all capital letters and spaces were correct .</p>
| 57124 | ||||||||
0 | How to create a tool cooldown server-side? | 436466229 | trecept | 367 | 2018-11-23 17:02:09 | <p>I'm creating a tool that I want the user to only be able to use every 2 seconds (as a cooldown), and for a client cooldown I would just wait(2) before firing the remote, but that's a bad practice for exploiters. I can't create a cooldown for the remote as it would act as a cooldown for all players, so how would I go... | 71033 | ||||||||
1 | Part and gui | 50095443 | SpaceEnder | 5 | 2014-03-06 00:06:45 | <p>Is there a way to make that when you put your mouse over a part a gui appears a by the brick? like the guns in apocalypse rising. If this is possible please tell me how or post an example of a model.</p>
| 510 | 2 | 843 | 0 | 25691148 | FromLegoUniverse | 264 | 2014-03-06 00:22:24 | <p>Ok, this is a little hard, I hope you know scripting with mouses.
The first step is to define the mouse using :GetMouse()
Next, you can do a while true do loop (or changed:Connect(Mouse)), and inside, check if the Mouse.Hit ~= nil and Mouse.Hit == Part Name, then if it is, do what you want.</p>
<p>Let me know if you... |
0 | How to make a W A S D dash system? | 536680102 | Lordverdeninja23 | 0 | 2023-02-26 10:03:54 | <p>I want to make a WASD Dash System however all the things I tried didn't work. I already have created animations for ASD and I want no animations for W. All I want is a simple teleport into your direction and set the animation based on it. It would also be great if it would have I-Frames.</p>
<p>I saved the animation... | 133125 | ||||||||
0 | How to make this gui dialogue script work? Visible-to-invisible transition not working | 1039602854 | Skyyrn | 1 | 2021-02-21 20:58:25 | <p>What I wanted to do is make a gui dialogue system for an Ancient Egypt-based game (project), so I came up with this script (please don't judge I'm very bad at scripting):</p>
<pre class='brush: lua'>local clickDetector = game.Workspace.Door.DoorPart.ClickDetector
local Pharaoh1 = script.Parent.ScreenGui.Pharaoh1
loc... | 120480 | 1 | 109861 | 0 | 1630076174 | TheStevenYt7758 | 13 | 2021-02-21 21:11:32 | <pre class="brush: lua">local Door = game.Workspace.Door.DoorPart.ClickDetector
local P1 = Game.StarterGuiScreenGui.Frame.Pharaoh1
local P2 = Game.StarterGui.ScreenGui.Frame.Pharaoh2
local P3 = Game.StarterGui.ScreenGui.Frame.Pharaoh3
local P4 = Game.StarterGui.ScreenGui.Frame.Pharaoh4 <--- erase all if the 2-5 not ... |
0 | How can I eliminate the mouse moving the camera in first person? | 1919723 | RoboFrog | 400 | 2014-10-07 21:32:47 | <p>I would like make it to where moving the mouse in first person will NOT effect the camera. This is for cutscenes, so I would also like to give user control of mouse based camera movement afterwards. I've already got everything else coded for the cutscenes, and this has been rather annoying since it will occasionally... | 11500 | ||||||||
0 | Knife to hand weld not working, can anyone fix it? | 1674805834 | Black_Magic2533 | 22 | 2021-07-21 16:55:15 | <p>I am making a 1v1 knife fight game that uses welds instead of tools can somebody help</p>
<p>Note : The game uses R6 rigs</p>
<pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(Player) -- Player
Player.CharacterAdded:Connect(function(Char) -- Character
local Head = Char["Right Arm"] -- Cha... | 125568 | ||||||||
1 | How do you make a player force chat something? | 69711409 | TheLuaDoge | 5 | 2017-04-19 12:35:03 | <p>i don't want custom guis and ChatSystemMakeMessage. just chatspeaker (i need help with it)</p>
| 42167 | ||||||||
0 | DataStore signalling script error? | 338950628 | RedcommanderV2 | 1256 | 2018-01-23 17:30:35 | <pre class='brush: lua'>local DataStore = game:GetService("DataStoreService")
local AS = DataStore:GetDataStore("AS")
game.Players.PlayerAdded:connect(function(player)
local PA = player.PlayerGui:WaitForChild("Main")
local PB = PA:WaitForChild("AttributesFrame")
local PC = PB:WaitForChild("UpgradePoints")
... | 52555 | ||||||||
0 | How can I prevent someone from respawning at the main spawn? | 654789870 | R4d1ant | 2 | 2022-12-28 05:03:07 | <p>I got a slight problem where whenever a player respawns, they have a chance of being respawned at the main SpawnLocation (where they're supposed to spawn in when they first join the game and choose their team) instead of their team's spawns. Is there anything I could do to prevent that from happening?</p>
| 132679 | ||||||||
0 | How would I return a value through a bindable function? | 11600866 | 1GREENBOB123456 | 15 | 2014-02-20 01:16:15 | <p>Sooo...
I have a Bindable Function called GetGamepasses, i want to make it so when i invoke the bindable function with my main script, it triggers another script and makes that script return a table to the main script. The return part wont work for me. Can somebody tell me how i would do that?</p>
| 146 | 3 | 287 | 2 | 849264 | blocco | 185 | 2014-02-20 03:26:02 | <p>In order to use <a target="_blank" href="http://wiki.roblox.com/index.php?title=BindableFunction">BindableFunctions</a>, you should understand the purposes for which you should use them. Normally, you would use BindableFunctions when you want to organize your code and expose APIs for other scripts to use. <a target=... |
6 | I'm scripting a basic translating script, but doesn't work. Please help? | 99448935 | NanotechSci | 40 | 2016-03-11 04:53:52 | <p>Some of you may know that ROBLOX shipped a new fonts system which is supported by UTF-8. (I think) So I wanted to create a basic translate script, where there's a welcoming GUI saying, "Hello, how are you" and it can be translatable to "¿Hola cómo estás?" (Also, if you're curious about the new fonts system that has ... | 28340 | ||||||||
0 | How to detect if player is standing still using an if statement? | 1648281165 | YuiiIsOld | 13 | 2020-11-10 03:57:45 | <p>I am trying to make a sprinting script both for mobile and pc, But the thing is that once your performing an animation like walking and click shift the animation will still play even if your standing still so im trying to make it so that you have to stand still to run using an if statement here is the code</p>
<pre ... | 115577 | 1 | 106173 | 1 | 1858692567 | DevMaster333 | 215 | 2020-11-10 12:33:58 | <p>There are multiple ways to detect if a character is standing still. The third method is the best since it doesn't consume as much memory as the first and neither needs to check the state of the character to determine if the player is idling as in the second method.</p>
<p>1) You could use MoveDirection to check if t... |
0 | This Animation Script Is Unable To Run. It has 2 Errors I am unable to fix. Could Anyone Help? | 355893114 | LoneSpace_Ranger | 4 | 2021-06-06 14:14:41 | <p>This is my script that wont work for some reason</p>
<pre class='brush: lua'>local rp = game:GetService("ReplicatedStorage")
local Combat = rp:WaitForChild("Combat")
local Animations = script:WaitForChild("Animations")
local anims =
{
Animations:WaitForChild("Kick")
Animations:WaitForChild("Left")
... | 124132 | 2 | 113171 | 0 | 521120979 | destinid10_2 | 50 | 2021-06-06 20:30:00 | <p>The tables, should have commas (,) to separate the contents.</p>
<p>For example:</p>
<pre class='brush: lua'>--Wrong Table example:
local table = {
1
2
3
4
}
</pre>
<pre class='brush: lua'>--Correct Table example:
local table = {
1,
2,
3,
4
}
</pre>
<p>Hope this help you.</p>
<p>Have an excellent day</p>
|
0 | I made a ralldoll death but how do I make it fly when the player die? | 180679010 | Eric_pokemon | 133 | 2020-04-19 16:50:12 | <p>so I made this basic ralldoll engine that if you die you turn into a ralldoll but i wan the ralldoll to fling when the player dies
heres the script</p>
<pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(c)
c.Humanoid.BreakJointsOnDeath = false
c... | 99886 | 1 | 92277 | 1 | 334433199 | EncapsuIation | 450 | 2020-04-19 17:49:57 | <p>I would use a VectorForce like this</p>
<pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(c)
c.Humanoid.BreakJointsOnDeath = false
c.Humanoid.Died:Connect(function()
for _, v in pairs(c:GetDescendants()) do
if v:IsA(... |
2 | Day/Night | 17219125 | vaugier7 | 10 | 2014-02-17 02:07:21 | <p>I feel really stupid D: Not the best with making scripts, but how do I create a basic day/night script?</p>
| 18 | 4 | 37 | 4 | 23476243 | MarkOtaris | 241 | 2014-02-17 02:21:24 | <p>In many of my games, I use code similar to this to change the time of day at a rate 60 times as fast as real time:</p>
<pre class='brush: lua'>while true do
Game:GetService('Lighting'):SetMinutesAfterMidnight(Game:GetService('Lighting'):GetMinutesAfterMidnight() + wait())
end
</pre>
<p>The reason this is 60 ... |
0 | Clicking on a tool giver gives more than 2 weapons? | 1961959172 | imnotaguest1121 | 74 | 2022-06-20 20:50:46 | <p>So anyway I made two tool givers GUI, one gives a knife and pistol, the other a AWP and bloxy cola however clicking on one of those two tool giver GUI's will both give It to them, A example, If I clicked the GUI to give me the knife Instead of the pistol, It will give me the knife but also the gun as well, happens v... | 130426 | ||||||||
0 | How do I find the player who clicked on a TextButton on a surfacegui? | 4330521 | whyOmustOitObeOme | 2 | 2015-01-07 05:25:31 | <p>I need to find the player after a textbutton in a surfacegui is clicked on, but I don't know how to retrieve the player, unlike a textbutton in a screengui. How can I do this?</p>
| 14058 | 1 | 17105 | 2 | 15619704 | NinjoOnline | 1147 | 2015-01-07 05:30:55 | <p>This is actually pretty simple. All you have to do is put the SurfaceGui inside <code>StarterGui</code> then use a LocalScript to get <code>game.Players.LocalPlayer</code> then <code>Adornee</code> it to the part with this: script.Parent.Parent.Adornee = game.Workspace.Part (Hopefully you should know how to edit it.... |
0 | How do i prevent myself from continually defining several variables that are the exact same code? | 76326675 | nich17 | 95 | 2015-01-22 23:55:29 | <p>an example of my problem is i keep ending up with my scripts starting like this</p>
<pre class='brush: lua'>local model = game.Workspace.model
local partA = model.partA
local partB = model.partB
local partC = model.partC
</pre>
<p>and i keep having to repeat that for several lines of code.</p>
| 14417 | ||||||||
0 | How do I make a function wait to execute until another function has finished before it? | 4338714 | OniiCh_n | 410 | 2014-02-27 04:29:34 | <p>What method(s) do I use to make a function wait until another function has finished?</p>
| 327 | ||||||||
2 | Time.deltaTime for Roblox Lua? | 6030494 | Exsius | 162 | 2015-04-04 03:50:48 | <p>Does anyone have a wiki link for the function if it even exists</p>
<p><a href="http://docs.unity3d.com/ScriptReference/Time-deltaTime.html">http://docs.unity3d.com/ScriptReference/Time-deltaTime.html</a></p>
| 16319 | ||||||||
0 | Sword Damage Script not activating? | 167536064 | MelodicSea5914 | 21 | 2020-07-30 17:28:04 | <p>Hi, I hope you have a good day. So, basically, I have this sword local script that allows me to fire an animation of the sword slashing and then return to an idol state. That works perfectly fine. However, I have another script that tells you how much damage to do when firing the local script (in this case, I put my... | 110317 | ||||||||
1 | How would I make a turret move by following the mouse? | 536049572 | NiroTurtle | 83 | 2020-09-25 03:21:51 | <p>So I am scripting a turret, and I need it to follow the mouse. The guns follow the Y of the mouse, and the body follows the X. So far, I've used Mouse.X and Mouse.Y and divide or subtract those numbers, but that has proven to be inefficient. Do you have any ideas on how I can do it?</p>
<pre class='brush: lua'>RS.Re... | 113610 | 1 | 104279 | 1 | 158811 | TGazza | 653 | 2020-09-25 06:54:15 | <p>The following script is from my prototype turret that uses constaints to move. It had 2 pitch and 1 yaw constraints and i had it follow a part in the workspace. You can hack it to work with the mouse. Since you have the mouse hooked up, just swap out the Firepoint varable and tweek the setting in <code>RotatetoTarge... |
0 | i set the position of a part, but it dont goes there. why? | 146100287 | Gigaset39 | 111 | 2023-03-02 16:23:24 | <p>i use this script to set the position of RED part:</p>
<pre class="brush: lua"> RED.Position = Vector3.new( -20.35, 20.51, 4.909)
</pre>
<p>but.. on roblox studio, the position is this, but when i try the game(in roblox studio) and the 2nd round starts( so this script fires) the RED part goes to another position.. ... | 133135 | 2 | 120228 | 0 | 1675553647 | MOJANGcreator091 | 60 | 2023-03-03 12:55:56 | <p>Hmm, This is a strange bug.
But I have some possible answers that may help</p>
<p>Answer 1
Use CFrame to move the part</p>
<p>If you dont understand CFrame, or you dont know how to use it there
some Tutorials that may Help you.
<a href="https://www.youtube.com/watch?v=9YqN8_VERps">http://www.youtube.com/watch?v=9YqN... |
1 | Making my own Pathfinding | 21280389 | SuperEvilAzmil | 25 | 2014-03-06 13:00:52 | <p>Sometime there're error while I'm using Pathfinding that i take it from this site: http://lessons.lualearners.org/lesson?id=77</p>
<p>Here's a script i make it for Zombie</p>
<pre class="brush: lua">local larm = script.Parent:FindFirstChild("Left Arm")
local rarm = script.Parent:FindFirstChild("Right Arm")
local wai... | 518 | ||||||||
0 | How do I send the Mouse.Hit of a PlayerMouse to the server from the client on FE? | 144115582 | TayBoss76 | 22 | 2018-05-07 20:25:28 | <p>I need a way to send/receive the Mouse.hit property of the PlayerMouse to the server for filtering enabled purposes. I have tried before by using InvokeClient in a RemoteFunction to return the mouse.Hit but it returned nil. Here is what I did (I KNOW THERE ARE TYPOS I WROTE THIS UP ON SPOT AS AN EXAMPLE)</p>
<p>----... | 58120 | 1 | 56728 | 0 | 31380948 | DeviantProphet | 50 | 2018-05-07 22:31:09 | <p>I'll show you how i did it</p>
<p>Server</p>
<pre class='brush: lua'> local GetMouse = replicatedStorage:WaitForChild("GetMouse")
local mouse = GetMouse:InvokeClient(player)
mouse = GetMouse:InvokeClient(player, folder) -- The folder is just what i parent everything to so i can use... |
0 | My script executer GUI wont execute? | 1674805834 | Black_Magic2533 | 43 | 2022-05-05 02:11:38 | <p>so the title might not make sense but bare with me, im making a GUI that can run scripts on the Server, im having an issue with the script saying "The current identity (2) cannot ExecuteScript (5)" these are the scripts</p>
<p>i first put a RemoteEvent in repStorage
then i put a local script in my execute button</p>... | 129915 | ||||||||
1 | Saving system switches values of both stats to equal? | 1546980603 | Jakob_Cashy | 67 | 2020-12-31 00:52:10 | <pre class='brush: lua'>local dataStore = game:GetService("DataStoreService"):GetDataStore("DiceomathyData")
local datst = game:GetService("DataStoreService"):GetDataStore("DiceomathyDataPoint")
starterRolls = 0 --This is the starter money
starterPoints = 0
game.Players.PlayerAdded:Connect(function(plr)
local leade... | 117931 | ||||||||
0 | How do I make an animation work? | 18697683 | ChipioIndustries | 454 | 2014-04-15 21:55:46 | <p>I have made a few animations myself, but I can't figure out how to make them run. Suggestions?</p>
| 1872 | 3 | 2474 | 5 | 55088775 | NotsoPenguin | 705 | 2014-04-15 22:00:37 | <p><a href="http://wiki.roblox.com/index.php?title=LoadAnimation_(Method)">http://wiki.roblox.com/index.php?title=LoadAnimation_(Method)</a>
<a href="http://wiki.roblox.com/index.php?title=AnimationTrack">http://wiki.roblox.com/index.php?title=AnimationTrack</a>
<a href="http://wiki.roblox.com/index.php?title=Play_(Met... |
0 | Gui property change on typing. | 32136988 | SecretShadowLeague | 0 | 2014-02-23 11:12:59 | <p>I have a script that SHOULD make the chosen Gui Text become a little more transparent 1/10 of a second when I say the key text.. it has no errors but won't work. I've tried a Server Side Script and a Local Script.. but it still won't work. Any help?</p>
<pre class="brush: lua">A = script.Parent
admin = { "SecretShad... | 250 | ||||||||
0 | So I have animations and they work fine in studio but not the published game, why does this happen? | 167154017 | yumaking | 63 | 2020-05-27 23:58:50 | <p>I have a tool that plays an animation when clicked and some other stuff, here is the code:</p>
<pre class='brush: lua'>--Script(Server)
local tool=nil
local char=nil
local effect=nil
script.Parent.Activated:Connect(function()
tool=script.Parent
char=tool.Parent
local id=tool.animParent.Animation
local anim=char.Huma... | 104575 | ||||||||
1 | How do you round up/down to one decimal? | 546234076 | Similaritea | 58 | 2019-05-25 11:56:57 | <p>Hello there,</p>
<p>I am wondering how you could round up/down values to one decimal? This is my script for a progress bar showing how many percentages you have completed in an obstacle course so far.</p>
<pre class='brush: lua'>--// Variables
local Players = game:GetService("Players")
local Player = Players.LocalPl... | 80691 | 1 | 75088 | 2 | 31953400 | thesit123 | 509 | 2019-05-25 13:59:57 | <p>Let's say you have the number <em>45.45783</em>, and you are trying to round it to 45.5:</p>
<p>You would move the decimal place to the right one time by multiplying it by 10.</p>
<pre class='brush: lua'>local number = 45.45783
local newNumber = 45.45783 * 10
-- 454.5783
</pre>
<p>Then add .5 to it, because 0 - 4 ro... |
0 | Attempt to index nil with character? | 1345056247 | Nexxive25 | 20 | 2021-06-08 16:06:39 | <p>I was running my code, and I got an error called "attempt to index nil with character. Can someone explain what this means?</p>
<pre class='brush: lua'>local Door1 = script.Parent.Door1
local Door2 = script.Parent.Door2
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdd... | 124196 | ||||||||
1 | how do you make a block "kill" a player? | 40102220 | xam345 | 5 | 2016-06-29 13:20:46 | <p>I am trying to create a obby on roblox and I am having trouble with the code for if a player touches the block to kill that player. It would be some really boring lava jumps without this! thanks for the help!</p>
| 32360 | 9 | 35371 | 3 | 29018475 | chill22518 | 145 | 2016-06-29 13:40:11 | <p>Simple, so start by creating a part and a script and placing it under the part</p>
<p>First start by making a variable for the part</p>
<pre class='brush: lua'>Lava = script.Parent -- script.Parent will refer to the Part
</pre>
<p>Now you want to create a function that kills a players</p>
<pre class='brush: lua'>fun... |
0 | Why Won't My Fireball Harm NPCs? | 316061618 | Crazeous | 183 | 2020-05-11 01:59:27 | <p>I'm working on a game that basically allows you to have superpowers, and the first power I'm creating is a fireball launcher. Whenever you click somewhere, a fireball mesh is sent to the location through a tween (the easingstyle is Enum.EasingStyle.Linear so it's going straight to the point). The fireball is suppose... | 102682 | ||||||||
0 | How do i make a script that finds the id of the player that has joined? | 1335034610 | ExCaliberDen | 3 | 2020-06-12 06:25:45 | <p>oof i can't find this any were so please help out.</p>
| 106169 | 1 | 97761 | 0 | 74087102 | Feahren | 5485 | 2020-06-12 06:37:25 | <p>You've really got to try harder to research your topic. I found it quickly using your title in fractions, both as a first result:</p>
<p><a target="_blank" href="https://developer.roblox.com/en-us/api-reference/property/Player/UserId">Player.UserId</a> | <a target="_blank" href="https://developer.roblox.com/en-us/ap... |
0 | Death animation. | 18369403 | Lem0nzz | 5 | 2014-03-05 20:26:58 | <p>How would you remove how your body parts fall apart? Because I was thinking of making a gun script where if you get shot, you do certain animations when you die.</p>
| 505 | ||||||||
1 | Key pressed problem? | 2869366 | Paldi | 109 | 2015-04-24 19:41:13 | <p>I have a problem with my script i made for a flying vehicle, i want that when the player get on the seat, he can use Q and E to have more movement controls but it dont work and i dont get any errors..</p>
<p>ps: the "--mouse" section is working.</p>
<pre class='brush: lua'>function onTouched(hit)
if hit.Parent.H... | 16965 | ||||||||
0 | How to Stop Movement of Humaniod? | 27691638 | 22To | 70 | 2015-01-28 01:29:47 | <p>I made a welcome Gui but i want it to freeze that player until it finished load\</p>
<p>here is script</p>
<pre class='brush: lua'>Gui = script.Parent.Parent
while true do
wait(49)
script.Parent:TweenPosition(UDim2.new(-2,0,-5,0), "In", "Back", 1,true)
end
</pre>
| 14570 | ||||||||
1 | Hi How Do I Make A Brick Change It Color Once To Green And Back When Touched Only Once? | 1554573538 | kidsteve923 | 139 | 2021-04-14 15:10:21 | <p>How do i make a brick change its color when I touch it to any color I want then for about 1 second it changes back to its original color Only Once Not All the time</p>
| 122379 | 1 | 111490 | 0 | 1792778813 | Xapelize | 2658 | 2021-04-14 15:19:11 | <pre class="brush: lua">partbeforecolor = script.Parent.Color3
debounce = false
script.Parent.Touched:Connect(function()
if debounce == false then -- cooldown for spam
debounce = true
script.Parent.BrickColor = BrickColor:Green()
wait(1)
script.Parent.Color3 = Color3.new(partbeforecolor)
debounc... |
0 | Adding a :Function() to the game instance? | 426476889 | H3xad3cimal | 0 | 2020-09-13 18:31:45 | <p>I want to do something like this:</p>
<pre class='brush: lua'>game:DeleteSomeObject( workspace.Part )
</pre>
<p>I was wanting to know if this is possible or not if so it would be helpful for me.
I would like to say yes I know how to destroy a part this is just a example</p>
| 113126 | ||||||||
0 | Why isn't this local script muting the sounds? | 215833213 | Stiles8353 | 35 | 2022-08-10 15:38:06 | <p>I have a sound regions music style, and I'm trying to use a mute button in the bottom right of the screen to mute the music if you want to.</p>
<pre class='brush: lua'>local hubmusic = game.StarterGui.SoundRegions.hubmusic
local off = false
script.Parent.MouseButton1Click:Connect(function()
print("music function... | 131180 | ||||||||
0 | Why the template in the Spawn Car Gui does not clone in for loop? | 2009611444 | bebokhouja2 | 38 | 2022-09-14 04:39:13 | <p>I was trying to make a LocalScript where the template clones every time there were children in ReplicatedStorage but however, but it did not do anything.</p>
<pre class="brush: lua">local template = script.Parent.ScrollingFrame.Template
for _, items in pairs(game:GetService("ReplicatedStorage").Cars:GetChildren()) d... | 131618 | ||||||||
0 | "argument 1 missing or nil" what's wrong and how do i fix it? | 2008585727 | Hastile_y | 0 | 2021-04-08 17:08:03 | <p>I'm trying to change the hair color of the character in an easy way using "WaitForChild" I've tried "FindFirstChild" too, but it only works if I put the specific name of that, butit can be any one depending on the choice of the player</p>
<p>(When the player appears, a folder is created on the "head" of the characte... | 122154 | ||||||||
1 | How do I make players heads bob in First Person? | 173792598 | Yirny | 30 | 2016-10-23 03:20:05 | <p>I'm making a horror game and I want it to be as realistic as possible. I want to know how to make the camera look in front of the players head for realism and to make it bob.</p>
| 36534 | 2 | 38981 | 2 | 98459280 | UniversalDreams | 205 | 2016-10-23 03:21:18 | <p>Of course you are setting up the camera for a player so you will use a LocalScript. However seeming difficult the method to create a head bobbing script is quite simple.</p>
<pre class='brush: lua'>local cam = workspace.CurrentCamera -- Define CurrentCamera
local lp = game.Players.LocalPlayer
repeat wait() until lp.... |
1 | Is there a way to use the MarketPlace service in studio? | 25691148 | FromLegoUniverse | 264 | 2014-03-01 06:41:23 | <p>I am planning to work on a new plugin with a donation ability, and I was curious if there is a way to activate the marketplace service while in studio. It is a simple yes/no question to me.</p>
| 384 | ||||||||
1 | How to make a script that removes all items in the backpack on death? | 51440452 | masterhalo55 | 75 | 2014-03-12 00:02:20 | <p>I'm making a game and i wan tall the guys when they died they loose there items in the backpack.</p>
| 641 | ||||||||
0 | How to anchor specific objects based on if they were previously anchored? | 87531166 | virushunter9 | 943 | 2019-11-08 01:03:28 | <p>Hello everybody, this is my first post so I am sorry if the formatting is wrong.</p>
<p>I am trying to make a "Time Stop" script, basically it would freeze(just anchor) eveything except the player who press F and called the RemoteEvent. What I am trying to do is to anchor everything except the player, and then unanc... | 89741 | ||||||||
0 | Why does the error "____ is not a valid member of Hopperbin" return? | 64081684 | cooldeath49 | 37 | 2018-04-26 21:21:28 | <p>Hi Helpers,
I've been scripting a place for a bit and I'm using WhupDup's weaponry. Go check it out if you'd like. Anyways, I'm trying to clone a weapon that is in replicated storage and put it into a players backpack.
here is the code. (ignore lines 1-38, useless)
Once I run it, the error returns, "Body is not a va... | 57459 | ||||||||
2 | If you press t, it will make the player sit, but it doesn't work? | 1533246993 | CountOnMeBro | 51 | 2021-06-09 23:57:32 | <pre class='brush: lua'>local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
if key:lower() == "t" or key:upper() == "T" then
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Character.Human... | 124237 | 2 | 113255 | 1 | 823902285 | MarTieMak | 56 | 2021-06-10 00:17:13 | <p>I tested out your script and it also did not work for me. I don't know exactly how your code did not work but I can help you out a bit.</p>
<p>First of all instead of putting 'game.Players.PlayerAdded:Connect(function(Player))' Its better to wait in your script until the player loads. Something like this would work<... |
0 | How can I make a (almost) duplicate line of code in the same script work? | 654789870 | R4d1ant | 2 | 2022-05-13 04:50:48 | <p>Hello!</p>
<p>I recently added a nametag system into my Roblox game which includes an uppertext (player's name), and a lowertext. Now the script and how it works is fine, but whenever I add another line of the "if player.Name == . . ." code after the first one to create a custom lowertext for another specific player... | 129986 | ||||||||
0 | How do I check multiple variables at once? | 1185917149 | TommyHArden | 99 | 2020-06-04 19:00:19 | <p>So I have a table.
My goal is to get the variables inside the table and compare them to something such as a players name. How would I do this multiple times? As the variables are named the same thing.</p>
<p>all i've really got is this but it will only check the first name in the table and not the second, sorry if t... | 105350 | 1 | 97081 | 0 | 835155757 | BRO_ITmeYO | 106 | 2020-06-04 19:15:48 | <pre class='brush: lua'>local nameWhitelist = {coolname, othercoolname}
for i,v in pairs[nameWhitelist]
if v == something then
--code
</pre>
|
1 | What's the difference between ServerScriptService and Workspace? | 173002126 | Michael_TheCreator | 166 | 2017-05-25 01:16:58 | <p>Obviously, the workspace can contain physical parts and so on but, does placing a script in ServerScriptService rather than putting it in the Workspace change anything about the script or how it would work?</p>
| 43209 | 1 | 44646 | 3 | 196317530 | Gamersofthegodss | 11 | 2017-05-25 01:22:58 | <p>Yes it does, depending on the contents inside the script, and what script it is</p>
<p>ReplicatedStorage: Used to put things into it to be both accessible to client and server. It differs from lighting since lighting has properties and has other ways to be used besides shoving stuff into it.</p>
<p>ScriptServerServi... |
0 | How to make a gui appear with topbar plus? | 593588871 | Charlesthebubble | 0 | 2022-03-07 15:21:46 | <p>I’m trying to make a gui appear I look at the website and it’s not help one bit</p>
| 129224 | ||||||||
0 | How would I make a brick always appear on the right side of my avatar? | 143777912 | TickTockTheory | 106 | 2017-04-02 22:23:27 | <p>I tried CFraming the position of the brick, but when i turn around and open the screen it appears on my left or right in front of me.. Could you guide me please?</p>
<pre class='brush: lua'>function openScreen()
if deb == false then deb = true
wait()
chr.Humanoid.WalkSpeed = 0
local sb = ... | 41595 | ||||||||
0 | Game stuck on loading screen? | 1251627904 | CodeWon | 25 | 2021-02-22 20:07:29 | <p>This doesnt have to do with scripting, but I didn't know where else to get help.</p>
<p>When I tried to join my game (in studio or on the website) it doesnt load at all.</p>
<p>I sat on the loading screen for ten minutes!</p>
<p>Does anyone know why?</p>
<p>(before someone asks, my internet was fine and I tried my i... | 120525 | ||||||||
0 | Does anybody know what's wrong with my 'if' Statement? | 6886175 | InsideExotic | 5 | 2014-05-08 21:19:06 | <p>Well I understand a bit of Lua but I need help on this if statement.</p>
<pre class='brush: lua'>function
Game.Workspace.Part1 = P1
Game.Workspace.Part2 = P2
if P1 and P2 = new.Color("Bright red") then --Here is my problem, how do you say color like this?
Print("They are both red!")
end
</pre>
<p>Anyone kno... | 4533 | 4 | 6134 | 3 | 18929555 | TurboFusion | 1821 | 2014-05-08 21:53:01 | <p>Well number 1, you're using <code>=</code> instead of <code>==</code>, number 2, the if statement is incorrect syntax, and number 3, <code>new.Color</code> isn't valid syntax. This is how it should be written:</p>
<pre class='brush: lua'>local P1 = game.Workspace.Part1
local P2 = game.Workspace.Part2
if P1.BrickColo... |
1 | Bullet sometimes doesnt go to the mouse's position? | 1624504218 | GameBuilderLol | 58 | 2021-05-22 06:38:01 | <p>So sometimes the bullet doesnt go to the direction my mouse is clicking at</p>
<p>heres is the script and the video that showcases my error:</p>
<p>link:
https://www.youtube.com/watch?v=6qeeu3uD46g</p>
<p>script:</p>
<pre class="brush: lua">local tool = script.Parent.Parent
tool.Equipped:Connect(function(mouse)
... | 123671 | 1 | 112750 | 0 | 129265755 | Vinceberget | 1420 | 2021-05-22 07:57:48 | <p>I've made a script which fixes this issue.</p>
<pre class="brush: lua">local tool = script.Parent.Parent
tool.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
local bullet = game.ReplicatedStorage:WaitForChild("Part"):Clone()
bullet.Parent = workspace
bullet.CFrame = ... |
1 | How to make a car/union type vehicle not flip over? | 419000434 | Omq_ItzJasmin | 666 | 2021-04-17 01:33:10 | <p>Hi. I'm making a ramp thingy, where you ride a cart kind of vehicle down it. Thing is, I have a conveyer belt to help it go up some ramps, so it makes it go really fast and bump into the walls (i have barriers). This causes the cart to go out of control, and most of the time flip upside down. I want to prevent it fr... | 122471 | 1 | 111604 | 1 | 121672610 | Speedmask | 661 | 2021-04-17 16:42:58 | <p>I know somebody who did this using <a target="_blank" href="https://developer.roblox.com/en-us/api-reference/class/AlignOrientation"><code>AlignOrientation</code></a>. you can change around the force so that it will always automatically rotate back onto its feet. just align it with some invisible part that is always... |
1 | Free model of gun won’t work and I’ve tried multiple times to fix, help? | 2008237911 | UCanttouchthis_0 | 5 | 2022-11-14 03:31:42 | <p>I found a free model of a gun. It won’t do any damage to players, only npcs. I don’t have my computer with me, but I would like to share snippets of code when I do. The gun does lots of damage to npcs but not players. Any help?</p>
| 132276 | ||||||||
2 | Decal Size | 25622294 | Muoshuu | 580 | 2014-02-27 00:26:42 | <p>What is the size roblox converts a decal to?</p>
| 320 | ||||||||
0 | How to prevent character from falling/ ragdolling? | 1071181471 | fcvrs | 22 | 2022-07-16 19:54:43 | <p>I have a script that slides the character using BodyVelocity in my game. Whenever I slide into an object, the character will fall and bounce away and I'm trying to fix this.</p>
<p>Ive tried disabling humanoid states with this:</p>
<p>hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
hum:SetStateEnabled(Enu... | 130821 | ||||||||
0 | how would I make a proximity prompt do something depending on if they have a tool equipped? | 785202132 | Borkingforlife | 9 | 2022-08-01 17:28:59 | <p>hello, I am trying to make a game where if you have a tool equipped and you activate a proximity prompt then it will give you one outcome but if you don't have the tool equipped then it will give you a different outcome.</p>
<p>Here is the code inside the tool:</p>
<pre class='brush: lua'>script.parent.Equipped:Conn... | 131045 | ||||||||
0 | Is it possible to make an iterator in Lua that can iterate over a dictionary? | 77284141 | movsb | 242 | 2017-07-02 19:37:21 | <p>Lets say that I have a dictionary in Lua (i.e. a Lua table that contains indexes of type string) like so:</p>
<pre class='brush: lua'>local my_dictionary = {a = 123; b = 321; c = 456; d = 654};
</pre>
<p>What I am trying to do is create an iterator function that can iterate over a table even if its indexes are of ty... | 44702 | ||||||||
0 | Im trying to make a script that makes u faster when u press left shift but how? | 1659997192 | CMB1048 | 25 | 2021-07-30 15:22:26 | <p>UserInputService = game:GetService("UserInputService")
local players = game.Players.LocalPlayer</p>
<p>local LeftShiftPressed = false</p>
<p>UserInputService.InputBegan:Connect(function(input,gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.LeftShift then
LeftShiftPressed = true
if players:Fi... | 125875 | ||||||||
0 | asking how to make a zombie spawner and wave? | 1651312250 | ninjaleon1919 | 0 | 2022-11-13 12:03:38 | <p>can anyone help me how to make a zombie spawner and wave?</p>
| 132267 | ||||||||
3 | What are brackets in lua? | 30125279 | yoshiegg6 | 176 | 2015-03-06 17:51:49 | <p>I've seen people use brackets [] in lua, what do they mean?</p>
| 15540 | 1 | 18673 | 4 | 386992 | BlueTaslem | 18066 | 2015-03-06 17:57:50 | <p>Square braces (or brackets) are used for <strong>indexing</strong>.</p>
<p>That means asking for a value <em>at</em> an <em>index</em>. Indexing is how you use tables (which are usually used as either <em>lists</em> or <em>dictionaries</em>.</p>
<hr />
<h1>List Indexes/Indices</h1>
<pre class='brush: lua'>local favo... |
0 | Can you pass tables in as arguments? | 30399843 | Protoduction | 216 | 2015-04-02 06:46:53 | <p>Just a quick question. Say I have a function, can I use tables in it's arguments?</p>
<p>Could a table that I defined earlier be passed in to a function?</p>
<pre class="brush: lua">function example(theTable)
end
local theTable = {"Hi","Bob","ScriptingHelpers"}
example(theTable)
</pre>
<p>If that works, I take it yo... | 16248 | 2 | 19494 | 6 | 46052 | chess123mate | 5873 | 2015-04-02 08:24:42 | <p>You can. In fact, I don't know if there's anything you <em>can't</em> pass as an argument - and that includes functions!
ex:</p>
<pre class="brush: lua">function Add1(n) return n+1 end
function Double(n) return n*2 end
function PrintN(n, Modifier)
print(Modifier(n))
end
PrintN(5, Add1) --prints 6
PrintN(5, Doubl... |
1 | Can I create custom Roblox Keybinds? | 5538435 | AwsomeSpongebob | 350 | 2014-05-19 20:59:34 | <p>I am curious if its possible to create a custom Roblox keybind, such as pressing 'C' for crouch? If so, do I need to use a Local Script, Script, or a certain function or something?</p>
| 5124 | 2 | 6900 | 2 | 22632759 | CardboardRocks | 210 | 2014-05-19 21:17:13 | <p>This is a <strong>LocalScript</strong> I put in the <strong>StarterPack</strong>.</p>
<pre class='brush: lua'>Sprint_Speed = 30 --[[The default walkspeed is 16 so]]--
--[[the Sprint_Speed number should]]--
--[[be higher than 16 ]]--
MyMouse = game.Players.localPlayer:G... |
0 | Why is this odd thing happening with cloning? | 153122776 | itsmtninja | 11 | 2022-09-19 12:40:47 | <p>I have made a tool, and when I test it out by putting it in StarterPack, it works as it should, but when I put it in ReplicatedStorage, and use a TextButton to 'buy' it, it gives me the tool, except it does not work. At first, I thought it was because the children weren't cloning, so I changed the script. I can see ... | 131674 | 1 | 118919 | 2 | 1961959172 | imnotaguest1121 | 362 | 2022-09-19 13:06:15 | <p>If Im correct, Its a local script thats causing the problem of your tools not functioning</p>
<p>the reason Is quite simple, whenever you press the Item giver, the local script will give you the Item. Don't be fooled though! as despite giving you the Item, It actually doesn't appear In the server side, you can check... |
0 | How to make if player get damage above 15 then take ragdoll or animation? | 512816640 | monus20022 | 0 | 2021-10-09 09:45:41 | <p>Hi. I trying to make it, but my level of scripting bad(My English is poor..sorry)</p>
<p>thank you in advance</p>
| 127819 | ||||||||
0 | Help with detecting incoming projectiles in front of my character? | 49856644 | TookMyTaco | 0 | 2023-01-15 21:58:20 | <p>Could someone please help me with my script? I am uncertain as to why it is killing me despite the absence of a moving part heading in my direction. Any help would be greatly appreciated.</p>
<pre class='brush: lua'>-- Get the position of the player character
local charPosition = game.Players.LocalPlayer.Character.H... | 132857 | ||||||||
0 | How does the Mouse Button1Down event work? | 1631699 | devSparkle | 84 | 2014-02-20 18:43:39 | <p>I just created the following script:</p>
<pre class='brush: lua'>-- Import animation
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=146374944"
-- Others
MyMouse = mouse
MyMouse.Button1Down:connect(playAnim)
-- Local variables
local animTrack = nil
local canPlay = ... | 175 | ||||||||
0 | DataStore is saying that an accessory has been saved, but nothing was saved? | 1182728095 | Dogcraft_01 | 10 | 2020-10-18 17:35:44 | <p>So, I’ve recently completed my accessory datastore. And when I tested it, the output said that everything was saved. But when I rejoin, the accessory has not been saved and it’s gone. Any help?</p>
<p>Here’s the code for the data store:</p>
<pre class='brush: lua'><br />local DataStoreService = game:GetService("Data... | 114531 | ||||||||
0 | City with sound and when entered in show something like a billboard? | 1103715 | LegoBlock222 | 5 | 2014-04-16 11:52:31 | <p>Hello, how I can make a city with his unique music and to show on the screen what's the name of the location/city/town and then disappear?
Please, respond to my question ASAP! Thanks for reading my question!</p>
| 2126 | 1 | 2835 | 1 | 47420928 | Scriptury | 70 | 2014-04-16 12:39:03 | <p>1) You need to make a GUI that with a TextLabel object in, that you can change to the name of the "location/city/town".</p>
<p>2) Then have a loop that checks whether the player is in a certain area, or it might be easier to have the baseplate of the location/city/town linked up to a touched event, so when someone w... |
0 | Why does this Int value decide to not subtract, and instead do the complete opposite?? | 153830228 | KCbiulder | 0 | 2022-09-11 23:13:40 | <p>I'm currently building an inventory/shop/buildable system, the inventory system relies on int values in a folder of the actual player to tell how many items each player has. A player can buy an item from the "shop" (on the right) then click on the item in there inventory GUI and place it. When a player buys an item ... | 131599 | ||||||||
0 | How do I get the player that fires an event? | 214881227 | ReallyUnikatni | 68 | 2018-11-03 21:54:45 | <p>I am working on a script where a button will fire an event and a script in serverscriptservice will run a function. I need the script to clone a tool in the player that fired the events backpack.</p>
| 69982 | 1 | 66810 | 2 | 87736336 | exxtremestuffs | 345 | 2018-11-03 22:44:03 | <p>Super easy, when connecting a function to that remote event, it's the first parameter (actually gave me quite a bit of trouble when I first started using them. You can access it like this:</p>
<p><code>RemoteEvent.OnServerEvent:Connect(function(player)
end)</code> Now of course you don't put any parentheses if your ... |
1 | I keep getting "Argument 1 missing or nil"? | 342770911 | NoRainbowGT | 14 | 2019-12-17 14:33:57 | <p>Error:
Argument 1 missing or nil</p>
<p>Stack Begin</p>
<p>Script 'Workspace.Sell Model.Sell.Part.Script', Line 16</p>
<p>Stack End</p>
<pre class="brush: lua">local Part = script.Parent
local plr = game.Players.LocalPlayer
local ID = 7697627
Part.Touched:Connect(function(HIT)
local H = HIT.Parent:FindFirstChild... | 91521 | 2 | 84722 | 1 | 78079406 | ScuffedAI | 435 | 2019-12-17 14:46:55 | <p>If we read the error message carefully, we'll see that the game is complaining because the first value given to the function at line 16 is <code>nil</code>. In other words your variable <code>plr</code> is nil. <code>plr</code> becomes nil because you are trying to get the localplayer in normal script.</p>
<p>If i u... |
0 | How do I make it so I can not have the fov change when the tool is unequipped? | 1817488477 | D00M1N | 2 | 2022-08-02 18:38:24 | <p>I want to make it so the fov won't change when the tool is unequipped, the current script doesn't work, here is my script:</p>
<pre class='brush: lua'>--The whole script doesn't work but if I remove this it works but still does it even if you unequip the tool:
--if tool.Unequipped then
--camera.FieldOfView = 70
loca... | 131068 | 1 | 118404 | 0 | 57053468 | aviel101 | 165 | 2022-08-02 18:46:09 | <pre class='brush: lua'>local mouse = game.Players.LocalPlayer:GetMouse()
local camera = game.Workspace.CurrentCamera
local tool = script.Parent
local character = game.Players.LocalPlayer.Character
mouse.Button2Down:Connect(function()
if tool.Parent == character then -- check if player is equipping the tool
... |
1 | How to clone object but constantly keep changing it's properties? | 393944663 | R0jym | 47 | 2022-07-01 11:20:25 | <p>Hello there, I have a script here where it's supposed to clone itself BUT continously update it's properties everytime it is cloned, like in this script where it's numbers add everytime it is cloned along with it's position, however I do not know on how to approach this and it does not seem to work, how do I remedy ... | 130594 | 1 | 117916 | 1 | 1014156252 | Puppynniko | 983 | 2022-07-01 11:38:02 | <p>You would want to put the Cloned Block into a Variable as i think you cant access the Cloned block if you dont
also you forgot to place the cloned block in workspace and you also need to have a currentNumber or it would add Block.SurfaceGui.TextLabel.Text as 0 to 1 then it would add 1 to 0 again after it cloned agai... |
0 | TouchTapInWorld second parameter ProcessedByUI Returns true if ContextAction is binded? | 1017846707 | Overseer_Prince | 188 | 2023-03-16 12:57:18 | <p>So Basically</p>
<p>the problem I have is simple</p>
<p>TouchTapinWorld's ProcessedByUI is supposed to return false if there is no UI that player touched</p>
<p>however for some reason when i bind ContextActionService</p>
<p>it returns true</p>
<p>does anyone know how I can prevent this?</p>
| 133196 | ||||||||
1 | How to make a GUI Gamepass Universe Teleporter? | 110258409 | Daiko_King | 1 | 2017-01-16 04:44:52 | <p>They've had one of these games when you press play and then it teleports you into another place, could someone teach me how to do that? I can't seem to get my head around it. Thank you.</p>
| 39068 | ||||||||
0 | How shall I include this script? | 3200702 | Michael007800 | 144 | 2015-05-08 18:24:13 | <p>So I have an answer to my needs, but I don't know how to input it into the script without breaking my game! Here is what I have!</p>
<pre class="brush: lua">while true do
wait(10)
local m = math.random(1,1)
there are
local player = game.Players:GetPlayers()
for i = 1, #player do --This checks for players and gets th... | 17365 | 1 | 20750 | 2 | 13416513 | Merely | 2122 | 2015-05-08 18:30:23 | <p>If you simply want to leave the character in its position and not teleport/move it at all, remove line 23 from your script.</p>
|
0 | [ ADVANCED ] GUI arrow won't follow a part in workspace? | 99934304 | 14dark14 | 167 | 2023-03-21 19:39:01 | <p>Hello, my goal is self-explanatory, have a Ui arrow point in the direction of a part that is in the workspace.</p>
<p>The issue is that I cannot figure out how to make the Ui arrow move freely on the Frame, it sticks to the side of the Frame, making it look "janky" by constantly teleporting around the Frame from sid... | 133224 | ||||||||
0 | [ISSUE SOLVED] Saving a table to a data store. How do I fix this error? | 61230738 | 800ChickenWings | 3 | 2020-08-02 04:27:24 | <pre class='brush: lua'>local DataStoreService = game:GetService("DataStoreService")
local dataStore = DataStoreService:GetDataStore("dataStore")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
loca... | 110524 | 2 | 101511 | 0 | 357316423 | Tizzel40 | 225 | 2020-08-02 04:47:34 | <p>The Problom Here is that , your script nerver Creates any data at all , Its just trying to get data.</p>
<p>And the data it is trying to get has never benn created so lets create it like this... :</p>
<pre class='brush: lua'>local DataStoreService = game:GetService("DataStoreService")
local dataStore = DataStoreServ... |
0 | Find nearest torso problem | 33167175 | 1N0body | 206 | 2014-02-21 07:34:54 | <pre class="brush: lua">player = game.Players.LocalPlayer
mouse = player:GetMouse()
function findNearestTorso(pos, maxDistance, randomSelect)
local list = game.Workspace:GetChildren()
local torsos = {}
for x=1, #list do
if (list[x].className == "Model") and (list[x] ~= script.Parent) then -- CHECK1
local torso = l... | 193 | 1 | 345 | 0 | 4030068 | jobro13 | 980 | 2014-02-21 10:43:02 | <p>If this LocalScript is in the ScreenGui of the player, then script.Parent is the ScreenGui. This is not a member of Workspace. You should check at line 7 if list[x] ~= game.Players.LocalPlayer.Character.</p>
|
0 | Ordered Data Stores: Can i save a table? | 3323648 | luachef | 61 | 2018-08-11 12:41:20 | <p>I'm working on a game, and these ordered data stores are something new to me. I have all my data auto saving to the standart data store. But i want to create global leaderboards. The question is: can i save my data table to an ordered data store? Or do i have to save each value for global leaderboard to a new data s... | 65210 | 1 | 63178 | 1 | 156586483 | Leamir | 2963 | 2018-08-11 14:20:38 | <p>Hello, luachef!</p>
<p>No, you can't save tables on OrderedDataStores, but you can on normal datastores</p>
<p>Saving normal Values:</p>
<pre class='brush: lua'>game:GetService("DataStoreService"):GetDataStore("DataName"):SetAsync("Stats", 255) --This will save 255
</pre>
<p>This will also work: (Table)</p>
<pre cla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.