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 you make an image change when you press a key? | 230241559 | Playstar08 | 0 | 2021-04-08 16:49:25 | <p>I was trying to do a test where, if I press the right key, it changes the image. For some reason the image turns invisible when I press right on my keyboard. Here is the script:</p>
<pre class='brush: lua'>local UIS = game:GetService('UserInputService')
local player = game.Players.LocalPlayer
local Main = script.Par... | 122152 | ||||||||
0 | RemoteEvent isn't working (not updating server), what am I doing wrong? | 91709180 | matiss112233 | 258 | 2020-07-08 00:50:17 | <p>I'm trying to update the server when I create these text labels above the player. I'm not getting errors, and it's printing, but the server isn't updating.</p>
<p>Here is my code:</p>
<pre class='brush: lua'>local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
lo... | 108489 | 1 | 99673 | 1 | 1658458271 | Padugz | 40 | 2020-07-08 03:22:21 | <p>Since you have already the 'Event:FireServer', might as well add a server script that will receive that event. The line 'Event:FireServer(BGUI, Name, Rank)' will pass the indicated parameters to the server script. Now, when the server script receives it, it will be the SERVER SCRIPT that will actually place all the ... |
0 | No error but the Gui doesn't move or become visible? | 206639588 | fifayy | 28 | 2021-05-01 03:39:04 | <p>I think the issue is with Local Script 1</p>
<p>Local script 1</p>
<pre class='brush: lua'>script.Parent.Activated:Connect(function()
local Theinfo = script.Parent.Parent.Parent.Parent.Theinfo.Frame
script.Parent.Parent.Visible = false
Theinfo.Visible = true
Theinfo.Position = UDim2.new(0, 0,5, 5)
... | 122980 | ||||||||
0 | How do I give a player a tool based off of a leaderstat? | 77371729 | pb_ub | 0 | 2022-06-24 00:00:13 | <p>I am trying to make it so a player gets a tool based off of their leaderstat. Basically I have a leaderstat called "Style" and based off of the value of that leaderstat it should give the player a tool based off of this. I've tried many things and I am about two months into roblox scripting.</p>
<p>here is my code:
... | 130485 | ||||||||
0 | There is this error that I cant fix how do I fix it? I'm trying to make a sprint script. | 1659997192 | CMB1048 | 23 | 2021-07-30 17:19:39 | <p>Error: 12:55:56.743 Players.CMB1048.PlayerScripts.LocalScript:22: Expected 'end' (to close 'then' at line 13), got <eof>; did you forget to close 'then' at line 18? - Studio - LocalScript:22</p>
<pre class='brush: lua'>UserInputService = game:GetService("UserInputService")
local players = game.Players.LocalPlayer... | 125878 | ||||||||
0 | [SOLVED]My local scripts aren't printing, anyone know why? | 1788996 | Jackd44 | 35 | 2014-02-27 10:49:41 | <p>Hello, sorry if I'm not doing this right, I'm new to SH.
But, I have a few local scripts(that actually have a multitude of bugs, but anyway...) and they're not wanting to print to the output, either output. For example, even this doesn't work.</p>
<pre class="brush: lua">wait()
LocalP = game.Players.LocalPlayer
Loca... | 332 | ||||||||
0 | How do I make a lever script to open a curtain? | 999502939 | Dragonboy99711 | 5 | 2020-06-23 06:00:24 | <p>For real, I had trouble with this. Can anyone help me make a lever script? I'm not sure how to do it.. It's supposed to open a curtain.</p>
<pre class='brush: lua'>--On Script
script.Parent.ClickDetector.MouseClick:Connect(function()
Lever1 = script.Parent.Parent.Lever1
Lever1B = script.Parent
Blink = sc... | 107154 | ||||||||
1 | What am I doing wrong with functions? | 11183939 | Grappler123 | 10 | 2014-04-17 12:41:55 | <p>Strangely whenever I do coding (I am terrible) it seems to think functions are well, not functions like when I do this...</p>
<pre class='brush: lua'>local brick = game.Workspace.Brick
function onTouch(part)
(something)
end
brick.Touched:connect(onTouch)
</pre>
<p>It always does this (or something like it)</p>
<pre ... | 2418 | 3 | 3360 | 0 | 33553423 | Ekkoh | 635 | 2014-04-17 14:04:13 | <p>@alessandro112 A lot of that is inaccurate. Anonymous functions aren't only called once, you just can't reference them anywhere. They're called every time the event fires, assuming they're connected to an event. I don't see why you wouldn't use <code>Players:GetChildren()</code> rather than <code>Players:GetPlayers(... |
0 | How can I make the 1st Person Body? | 73428443 | DaScr1pt3r | 0 | 2014-11-29 07:58:34 | <p>How can I create the realistic 1st person body when zoomed in?</p>
| 12842 | ||||||||
1 | Which option is best to keep an overview and will I have to use from now on? | 429417358 | Bankrovers | 226 | 2021-07-17 17:56:07 | <p>Hi, I would like to know which of the options below is the best for detecting when a player enters the game. Then I know immediately which one I will use from now on.</p>
<p>Option 1:</p>
<pre class="brush: lua">local Players = game:GetService("Players")
local function PlayerAdded(Player)
end
Players.PlayerAdded:Con... | 125411 | ||||||||
0 | Not taking tat much damage? | 27621739 | FiredDusk | 1466 | 2015-08-19 20:30:57 | <p>This script takes away 100 health. I want it to take away 50%</p>
<pre class='brush: lua'>script.Parent.Touched:connect(function(Obj) -- When you touch it gets the "Leg" or "Arm"
local Player = game:GetService("Players"):GetPlayerFromCharacter(Obj.Parent)
-- Gets the Instance "Player"
if Player and Playe... | 21646 | ||||||||
0 | How would you remove trailing and leading whitespace? | 849720475 | Kami_Yo | 72 | 2019-05-04 05:47:32 | <p>Right now this takes a bunch of words separated by a comma and spits them up by the comma. My only issue is that the words after the comma have leading spaces. How would I remove leading and trailing spaces in strings?</p>
<pre class="brush: lua">for reqSkill in string.gmatch(skillData[6], '([^,]+)') do
print(re... | 79814 | ||||||||
0 | Attempt to index nil with "FindFirstChild" any solutions? | 76150101 | xIshFudge | 84 | 2020-04-02 19:23:15 | <p>Notes ~ this is inside StarterPlayerScripts, which has an Integer Value named "Air", this is a local script inside of "Air"</p>
<p>Hey all, so I'm trying to make a game where you have a set amount of oxygen and when you run out it starts to damage you. So I made the first part work</p>
<pre class='brush: lua'>local ... | 97900 | 2 | 90417 | 1 | 74087102 | Ziffixture | 6913 | 2020-04-02 19:41:02 | <p>This is because the Player's Character can sometimes take too long to load. Simply add a <code>CharacterAdded:Wait()</code> to yield the Character Object return until it is available.</p>
<pre class='brush: lua'>local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.Charac... |
0 | Custom footstep sound script not working? | 1565853299 | KneeDeepInTheDoot | 4 | 2020-12-29 20:44:43 | <p>So, I wanted to make a footstep sound script for my game, but somehow, it doesn't work!
It's parented to StarterCharacterScripts. (which automatically parents the scripts inside it to any joining player)</p>
<p>Here is my code sample.</p>
<pre class='brush: lua'>local WalkSoundOrigin = script.Parent:FindFirstChild("... | 117866 | ||||||||
0 | How can I get a specific part of a chat message using a table? | 861475515 | kek_productions | 7 | 2023-01-04 14:18:01 | <p>Sorry for the horrible code.</p>
<p>I want the game to listen out for objects stored in my serverstorage (table), and when someone calls it out it spawns it in game. At the moment it prints twice and it's always nil.</p>
<pre class='brush: lua'>local chat = game:GetService("Chat")
adjectives = {""}
objects = game.Se... | 132755 | ||||||||
0 | Make all parts in a model transparent at once instead of one at a time? | 971000975 | 1yz4 | 2 | 2022-06-24 08:07:04 | <p>https://i.gyazo.com/d5ecd8aa50f846c9cff40b9aecf21ba6.gif</p>
<p>My script how it currently is:</p>
<pre class='brush: lua'>-- "Fade" is the brick that triggers the transparency when stepped on.
-- "Robloxian" is the model.
local invis = true
game.Workspace.Fade.Touched:Connect(function(hit)
if not invis then ret... | 130494 | 3 | 117836 | 0 | 57053468 | aviel101 | 105 | 2022-06-24 19:34:42 | <p>i edited cmgtotalyawesome's script a bit, it should be working</p>
<pre class='brush: lua'>local invis = true
local parts = {}
workspace.Fade.Touched:Connect(function(hit)
if not invis then return end
if not hit.Parent:FindFirstChild("Humanoid") then return end
invis = false
for k2,v2 in pairs(game.W... |
1 | How to pop up a gamepass when someone touch a brick? | 316486855 | densomenso999 | 11 | 2020-04-08 19:08:55 | <p>okey so i want to make something like 'touch here to buy game pass' and i search pop up gamepass script or brick and i found a script, but when i touch the brick it says the item is not currently available.</p>
<p>the script:</p>
<pre class='brush: lua'>function onTouch(hit)
script.Disabled=true
local pla=game... | 98525 | ||||||||
0 | Why does this code not work and how would i check the players team? | 1014156252 | Puppynniko | 983 | 2022-04-01 05:12:15 | <pre class='brush: lua'><br />local part = script.Parent
local Shot = script.Parent.Parent.ShotPart
local firerate = 0
local dmg = 100
local speed = 170
local range = 1000
local db = true
local rep = game.ReplicatedStorage:WaitForChild("TeamEvent")
--[[local targets = {
game.Workspace.Model:GetDescendants():GetDesc... | 129510 | ||||||||
0 | Is there anyway to use Players:GetUserThumbnailAsync() on SurfaceGUI? | 871079581 | Confidencebreath | 8 | 2021-06-20 02:06:17 | <p>Hello, I'm a scripting problem with Player:GetUserThumbnailAsync() because I was trying to use it on a SurfaceGUI, but however it doesn't seem to work on it, only on ScreenGuis is there any way to fix this?</p>
<pre class='brush: lua'>local Players = game:GetService("Players")
local player = Players.LocalPlayer
loca... | 124571 | 1 | 113525 | 0 | 94006350 | BulletproofVast | 1033 | 2021-06-20 05:53:00 | <p>Local scripts won't work in workspace. You could do <code>local imagelabel = workspace.Part.imagelabel</code> from starter player scripts or some other location.</p>
|
0 | How To Change a Animation Keyframe With Script? | 1112337243 | Pejoume | 11 | 2023-01-11 16:34:57 | <p>Okay so I'm trying to make a katana combat system and in order to make it work without looking stupid I have to make the katana swing at the same height that the player's camera is looking. So my question is how would I be able to edit an animation so that the Y vector on the Character's arms is different from how i... | 132807 | ||||||||
0 | Why wont this SetPrimaryPartCFrame() script work? | 118756138 | PlanetDevv | 5 | 2016-11-27 01:28:39 | <pre class="brush: lua">local Sensor1 = script.Parent.S1
local doorl1 = script.Parent.L1
function onTouched(hit)
for i = 20,0,0.01 do
doorl1:SetPrimaryPartCFrame(CFrame.new(i, 0, 0))
wait()
end
end
Sensor1.Touched:connect(onTouched)
</pre>
<p>Why doesnt this work? Help please :(</p>
| 37541 | ||||||||
0 | How do I connect a team with a spawn? | 689433817 | l7mf | 2 | 2020-01-06 21:06:36 | <p>I've tried putting the same color to it but it won't work lol. So I wanted to ask how to connect the team e. g. Passenger to a spawn.</p>
| 92675 | ||||||||
0 | Make teleportation happen only once when a player joins the game? | 964031717 | bobdrix | 0 | 2023-01-24 05:38:57 | <p>My code(not full part)
Server:
local changeslot1event = Instance.new("RemoteEvent")
changeslot1event.Name = "changeslot1event"
changeslot1event.Parent = game.ReplicatedStorage
local slot1 = Player:WaitForChild("PowerFolder").slot1join.Value</p>
<p>local function slot1up()
slot1.Value = slot1.Value + 1
end</p>
<p>slo... | 132931 | ||||||||
0 | Skip errors in scripts when people leave? | 33666987 | XDgirl909090 | 143 | 2020-03-28 19:35:02 | <p>If this isn't allowed on this site, I'll take it down.
Is there a way to make scripts skip over an error rather than have the whole game break?</p>
<p>For example, if code is running on a player that leaves. Can I just skip the error and move on?</p>
<p>Thanks</p>
| 97357 | 1 | 89939 | 0 | 244452876 | Jessesong | 1430 | 2020-03-28 19:36:08 | <p>You can use a pcall to check whether you script is going to work or not.</p>
|
0 | Surface GUI | 1631699 | devSparkle | 84 | 2014-03-06 13:52:43 | <p>Hello,</p>
<p>I have made an Alarm based on a surface GUI, how do I make it so only people in a Certain group with a certain rank can click the button?</p>
<p>Thank you,
-dev</p>
| 519 | 1 | 858 | 2 | 35339312 | ImageLabel | 1541 | 2014-03-06 16:35:48 | <pre class="brush: lua"> if Player:GetRankInGroup(GROUPID) == Rank then
</pre>
<p>.Touched</p>
<pre class="brush: lua">Workspace.Part.Touched:connect(function(otherPart)
print(otherPart)
end)
</pre>
<p>http://wiki.roblox.com/index.php?title=Touched_(Event)</p>
<p>MouseButton1Click</p>
<pre class="brush: lua">gui.M... |
0 | Can you loop a message? | 72288949 | iiMaaster | 0 | 2015-03-15 02:16:33 | <p>Hi, im iiMaaster283 and i am asking how to loop a message or if you can.</p>
<pre class='brush: lua'>rm = game.Workspace.AddMessage
> while true do
rm.Text = "rekt n00b"
rm.Text = "OMG A NOPESCOPE"
end
</pre>
| 15779 | 1 | 18919 | 0 | 3508838 | DigitalVeer | 1473 | 2015-03-15 02:23:54 | <p>Of course you can loop a message!
And in fact, you are very close!
Just add some <code>wait()'s</code>!</p>
<pre class='brush: lua'>rm = game.Workspace.AddMessage
while true do
wait(1)
rm.Text = "rekt n00b"
wait(1)
rm.Text = "OMG A NOPESCOPE"
end
</pre>
|
0 | How to only allow a certain amount of childs in a UIGridLayout? | 538824226 | Brioche_Noodle | 45 | 2023-02-15 12:41:57 | <p>I am making a notification GUI in my game so I am using UIGridLayout to make a grid.
But my problem is that when I add in a lot of placeholders ( Frames ) It makes another line of placeholders which looks messy.
So I went into UIGridLayout and changed a property in it. Changing FillDirectionMaxCells only allows a ce... | 133074 | ||||||||
1 | How do I keep models in workspace when they fall into the void without causing performance issues? | 922412310 | woodboiz | 11 | 2021-06-11 22:43:49 | <p>I recently fixed a respawn script and it works great, but when the objects fall into the void they stop spawning because they get deleted from workspace, meaning they cannot be respawned. Is there any loophole around this without major performance issues?</p>
<p>Here's the current code that I am using:</p>
<pre clas... | 124298 | 1 | 113316 | 0 | 1057250798 | ElBamino | 153 | 2021-06-11 22:52:08 | <p>So, to expand on my comment and explain it better. I recommend putting the model in ReplicatedStorage. This is extremely useful, it doesn't cause lag plus its always there when you need to clone it again! There's different ways to go about respawning (aka cloning) the model after this so below I will provide you wit... |
1 | How do I use the In-Game Notification system for ROBLOX? | 678299 | MillerrIAm | 566 | 2020-01-31 00:44:02 | <p><strong>I DO NOT WANT A SCRIPT FROM THIS.</strong>
Hello! I am attempting to learn how to access the Notification System but I have no idea how to do it. I can't seem to find any articles that tell me what I need to know. I looked at the dev forum and I can't seem to find much on it. I tried looking over the SetCore... | 93856 | 2 | 86711 | 4 | 49773669 | cowsoncows | 946 | 2020-01-31 01:02:21 | <p>What you're looking for is called <a target="_blank" href="https://devforum.roblox.com/t/game-update-notifications/155600">Game Update Notifications</a>
Currently we're limited to sending only 1 notification per week, and the notification will only go to those who are following the game.
The notification isn't handl... |
0 | Why does my 1 lined code that should only let players through not work? | 51100371 | joostie1 | 0 | 2022-05-22 18:21:13 | <p>I searched all over internet but can't find why my script doesn't work. I want to create a wall wich only Players can walk through and nothing else. so i created in starterplayerscripts a localscript with:</p>
<pre class='brush: lua'>game.Workspace.noPassZombiewall.CanCollide = false
</pre>
<p>but if i try this out ... | 130077 | ||||||||
0 | Shift to sprint with animation help? | 183350263 | SuperGemarCatYT | 0 | 2021-09-30 09:53:29 | <p>Im trying to make a script to make it so that when the player presses shift the fov changes, speed changes and it plays my animation until shift is unpressed heres my current script:</p>
<p>local UIS = game:GetService('UserInputService')</p>
<p>local Player = game.Players.LocalPlayer</p>
<p>local Character = Player.... | 127751 | ||||||||
1 | Moving an event out of a function makes it not work? | 15288675 | emite1000 | 335 | 2015-02-23 04:37:11 | <pre class='brush: lua'>function Response()
Rpns = Instance.new("TextButton", scrl)
Rpns.Position = UDim2.new(0, 40,0.78, 0)
Rpns.Size = UDim2.new(0.75, 0,0, 10)
Rpns.BackgroundTransparency = 1
Rpns.Font = 1
Rpns.FontSize = 4
Rpns.TextColor3 = Color3.new(255, 0, 0)
... | 15241 | 1 | 18313 | 4 | 386992 | BlueTaslem | 17922 | 2015-02-23 05:09:04 | <p>Nothing has called <code>Response()</code>, so there's no such thing as <code>Rpns</code>.</p>
<p>If you do</p>
<pre class='brush: lua'>Response()
Rpns.MouseButton1Click:connect(function()
Txt.Text = ("Bla bla bla.")
end)
</pre>
<p>It will work. <strong>BUT</strong> <strong>you shouldn't</strong>.</p>
<hr />
<p>... |
0 | How to save progress of being on a team? | 1791946066 | PandaKeai | 10 | 2022-06-22 05:56:38 | <p>I'm trying to figure out how to save progress from being in the game, then rejoining. You are put into a team once you hit a block, and this team determines you respawning at the checkpoint, which I have already done. The problem is that I want this to save from the next time you join. How would I go about this? Any... | 130452 | ||||||||
1 | I can't Re-dock the Properties tab into Roblox Studio? | 107637223 | BobbieTrooper | 7 | 2020-02-14 21:56:00 | <p>Since the last couple of days i cannot resize/redock my properties tab into my studio. It seems like it is opened out of Roblox Studio, I can drag it, i Can close it etc. But nothing else.
Also my properties Tab is 5 times longer than my screen, in lenght.
Here is a Link to my issue: http://prntscr.com/r2hxnb</p>
| 94581 | 1 | 87368 | 0 | 714312166 | PrismaticFruits | 842 | 2020-02-15 10:27:54 | <p>I may know how to fix this:</p>
<p>Drag the properties window over to the Explorer, as if you were trying to move it off the screen. If you do that is should fit exactly into where the explorer is.</p>
<p>If this helped please accept this answer.</p>
|
0 | How would I make a script that checks if a part is touching nothing? | 878735180 | poop07393cfhi3n2222 | 4 | 2021-05-20 21:08:07 | <p>Right now, my script looks like this:</p>
<pre class='brush: lua'>if script.Parent:GetTouchingParts(nil) then
end
</pre>
<p>But that doesn't work. How would I make it so that it works?</p>
| 123631 | 2 | 112715 | 0 | 307975085 | realemptybox | 33 | 2021-05-20 21:13:55 | <p>try to check if the length of the table that <code>GetTouchingParts()</code> is returning is equal to 0:</p>
<pre class='brush: lua'>if #script.Parent:GetTouchingParts() == 0 then
end
</pre>
|
1 | This error when the script is destroyed:Player:Move called, but player currently has no humanoid? | 936672304 | kodakpro87 | 7 | 2020-12-17 22:28:59 | <p>This is my script: wait()
local Humanoid = script.Parent.Humanoid
Humanoid.BreakJointsOnDeath = false
local DA = Instance.new("Animation")
DA.AnimationId = "rbxassetid://6101308551"
local DeathAnimation = Humanoid:LoadAnimation(DA)</p>
<p>Humanoid.HealthChanged:Connect(function(Health)
if Health <= 0 then
print("... | 117309 | 3 | 107511 | 0 | 2007599571 | RedReedBird | 205 | 2020-12-18 00:02:45 | <p>This is because the humanoid is not currently loaded in. You have to wait for it, like this:</p>
<pre class="brush: lua">local Humanoid = script.Parent:WaitForChild("Humanoid")
</pre>
|
3 | How do I sort a dictionary and is that possible? | 14277028 | rodrigo455 | 578 | 2018-06-30 12:43:50 | <p>So let's imagine a dictionary which has these values in it:</p>
<pre class='brush: lua'>Items = {
["Item1"] = 50,
["Item2"] = 200,
["Item3"] = 100
{
</pre>
<p>Assuming this is a shop and we want sort it by price, we would want it to look like this:</p>
<pre class='brush: lua'>Items = {
["Item1"] = 50... | 61476 | 2 | 59859 | 3 | 16542699 | mattscy | 3725 | 2018-06-30 13:12:55 | <p>As dictionary keys are not integers, they cannot be sorted. Arrays, however, have integer keys, giving them an order. So, there are multiple ways of ordering your item table:</p>
<p><strong>1. Get rid of item name:</strong></p>
<p>If the item name isn't required, you can simply do this:</p>
<pre class='brush: lua'>I... |
0 | Argument 1 missing or nil error in RemoteFunction? | 303357794 | ColdFoxy07 | 76 | 2021-04-11 19:33:11 | <p>I got an error trying to use a RemoteFunction from server to client to try and create a Hitmarker. I couldn't find any way to fix it, so i decided i was going to ask it here.</p>
<p><strong>Error:</strong></p>
<blockquote>
<p>Argument 1 missing or nil</p>
</blockquote>
<p><strong>Server Script:</strong></p>
<pre cla... | 122277 | 1 | 111382 | 0 | 89430243 | Amiaa16 | 3227 | 2021-04-11 21:33:13 | <p>You have to pass a player instance to <code>InvokeClient()</code></p>
<pre class='brush: lua'>if humanoid then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
game.ReplicatedStorage.Hitmarker:InvokeClient(player)
</pre>
|
0 | How to make the players character.Humanoid.RootPart teleport to a chosen place? | 374139517 | mymatevince1215 | 9 | 2022-01-04 22:21:18 | <pre class='brush: lua'>inround.Changed:Connect(function()
if inround.Value == true then
for i, plr in pairs(game.Players:GetChildren()) do
local char = plr.Character.Humanoid.RootPart
if forestmapworkspace == true then
local tpparts = math.random(1, #maps:WaitForChil... | 128698 | 2 | 116541 | 0 | 929847335 | TheDude646 | 72 | 2022-01-05 05:04:33 | <p>the <code>HumanoidRootPart</code> isn't parented to the <code>Humanoid</code> object, but to the character model. try <code>plr.Character.HumanoidRootPart</code></p>
|
1 | Can someone help me use percentages properly in my script? | 67015061 | ErskinePierre | 48 | 2020-07-23 17:38:09 | <p>I wan't to make it so that the less blood you have, the less damage you deal. If your blood is at 100%, you deal normaI damage. I was thinking of using a percentage to do this.</p>
<p>I was thinking of something like this.</p>
<pre class='brush: lua'>Humanoid:TakeDamage(dmg / %ofblood)
</pre>
<p>but honestly I don't... | 109782 | 1 | 100904 | 1 | 61269847 | RAFA1608 | 448 | 2020-07-23 18:05:35 | <pre class='brush: lua'>local percentofblood = 100
local damage = 10
local dmg = damage/100 * percentofblood
--Humanoid as in the victim you've hit
Humanoid:TakeDamage(dmg)
</pre>
<p>Basically what this does, is that it divides it by one hundred, and multiplys it by the percentage of blood. If its 99% of blood, itll be... |
1 | How does gsub work exactly? | 5538435 | AwsomeSpongebob | 350 | 2016-01-31 20:37:14 | <p>I've read the wiki article on gsub, and I dont completely understand how it works. I get that it replaces certain things in a string, can fund patterns, etc, but that's about it. Can I use gsub to replace individual letters & numbers within a string with other letters & numbers? Any help is appreciated, than... | 26910 | 1 | 30444 | 5 | 65765854 | eLunate | 5136 | 2016-01-31 21:13:21 | <h1>gsub stands for <em>global substitution</em></h1>
<p><code>function gsub(string, match, sub) -> newString</code><br />
Every time it finds a part of the string matching a pattern at <code>match</code> and replaces it with <code>sub</code>. There are a few special cases for using gsub:</p>
<h3>If <code>sub</code>... |
1 | Could someone explain how to use TweenService to me? | 161262344 | sean_thecoolman | 189 | 2019-08-17 23:13:49 | <p>So the last time I tried to make a smooth moving object (a rocket), I abused a for loop way too much, because I do not know how to use the TweenService. Could someone explain to me how to use it and maybe give an example?</p>
| 86035 | 2 | 79816 | 0 | 66702178 | UNBANhappyniceguy5 | 52 | 2019-08-18 01:59:56 | <p>So to use TweenService you need to put this in your game at the start of the script</p>
<pre class='brush: lua'>local tweenService = game:GetService("TweenService")
</pre>
<p>Then lets say you want to move a part, you'd need to give information about the tween (ex, how many times it will do this movement)</p>
<pre c... |
0 | How can you get more /e Animations? | 43933656 | ParlaPenny | 0 | 2014-03-02 21:23:39 | <p>I was playing Ro-Rap battle, and a guy said /e flap and he went into the air, and hands started clapping.
I checked his profile, and his primary group was Scriping Helpers.</p>
| 450 | ||||||||
0 | Why is my Blender fbx mesh not importing into Roblox Studio? | 1204864571 | MarkoFANTASTINE1 | 15 | 2021-03-03 17:18:15 | <p>So I made my first terrain model, I inserted a MeshPart into Roblox Studio, and imported my fbx mesh file.</p>
<p><strong>Errors:</strong></p>
<p>When I import it I get an error:</p>
<blockquote>
<p>"Error while creating named asset: Could not upload MeshPart"</p>
</blockquote>
<p>and sometimes I get this error:</p>... | 120907 | ||||||||
1 | Give Tool to Player upon MoveTo | 25842304 | bloxxyz | 274 | 2014-03-01 21:12:41 | <p>Okay, so this script is seemingly long. But I just have a problem with a couple lines. I'll comment out the portion I need help with. But before you read, here's the problem:</p>
<p>I'm trying to make the Player receive a tool titled "Sword" upon position movement. Everything works well, it loops successfully, the t... | 410 | ||||||||
0 | How can I make a billboard GUI in a part disappear when the part disappears? | 654789870 | R4d1ant | 2 | 2022-05-13 22:16:36 | <p>Title says it all.</p>
<p>I'm trying to make good-looking text above a button (part) using billboard GUI, but whenever you walk over the button (to buy something), the text just ends up staying there even after the button disappears. How can I fix it?</p>
<p>Thanks.</p>
| 129992 | 1 | 117403 | 0 | 1608691335 | scripterhelper5354 | 854 | 2022-05-14 13:38:08 | <pre class='brush: lua'>local part=script.Parent
local gui=part:FindFirstChildOfClass"BillboardGui"
part:GetPropertyChangedSignal"Transparency":Connect(function()
if part.Transparency==1 then
gui.Enabled=false
end
end)
</pre>
|
0 | Is there a better way to write this item despawn code? | 87531166 | virushunter9 | 943 | 2020-05-15 13:31:36 | <p>I have a system where if an item(default roblox tool) is not picked up after it's despawn time, it destroys itself and is despawned, however if it is picked up by a player, it is counted as "PickedUp" and will no longer despawn. Since this is my first time doing something like this, I was wondering if there is a mor... | 103196 | 1 | 95431 | 1 | 1505768595 | PSWasHere | 20 | 2020-05-16 18:35:36 | <p>It looks good, but line 17 should be:
<code>if PickedUp == false then</code></p>
<p>A more simple way would be:</p>
<pre class='brush: lua'>spawn(function()
local ToolClone = Tool:Clone()
ToolClone.Parent = game.Workspace
wait(300)
if not ToolClone.Parent:FindFirstChild("Humanoid") and not ToolClone:... |
0 | Terminal GUI timer? | 5912740 | trebor76 | 0 | 2014-04-16 23:59:44 | <p>Time = script.Parent.Time
code = game.Workspace.Terminal.raidtime.Value</p>
<p>while true do
Time.Text = "RAIDTIME:".." "..code
wait(1)
end</p>
<p>Why won't this work?
It changes to</p>
<p>RAIDTIME: 400 but wont go down or up just stays...</p>
<p>Help!</p>
| 2313 | ||||||||
2 | Drawing a 2D line between 2 points? | 757754719 | enhanceddevelopment | 12 | 2018-10-12 05:05:28 | <p>I'm creating a gamepass for my game - this gamepass will allow users to purchase a 2D box ESP [only during frenzy mode], giving them an advantage over players who only have access to the radar (which I plan to have all users visible on at all times, during something I'm calling "frenzy mode" in my FPS).</p>
<p>To do... | 68779 | 1 | 65861 | 2 | 149258954 | RayCurse | 1513 | 2018-10-12 15:54:21 | <p>You want to position <code>LineHandle</code> such that it connects two points. First for the sake of simplicity, it will make it much easier if the anchor points of all gui elements involved in the positioning of this line have their <a target="_blank" href="https://www.robloxdev.com/api-reference/property/GuiObject... |
1 | How To Find Table Value's Position? | 71530978 | enes223 | 312 | 2019-09-03 19:50:54 | <p>Im trying to sort player join order in a local script but I cant figure it out and I thought about this bbut I dont know how to make this can someone help me?</p>
| 86968 | 2 | 80567 | 1 | 20111088 | royaltoe | 5144 | 2019-09-03 21:03:30 | <p>Hi, the table will already be sorted based on when people join. table.insert will add the player's name at the end of the table. The if statement you have inside of the playeradded function will not work as the player joining will always be the player you need to add to the array.</p>
<p>gtg so i didnt get to test t... |
0 | How do you get the Date and time from Unix Epoch time? | 2966752 | Validark | 1580 | 2015-12-11 04:27:01 | <p>I want to be able to use tick() or os.time() to get the current date and time. How would I do so?</p>
| 25121 | ||||||||
0 | How can I store color3 values in a datastore? | 6942109 | FakeWhatWeDontKnow | 0 | 2021-01-13 11:46:16 | <p>I know you have to do this as a table but when I tried this I couldn't get the DS to update it, I'm making a colour customizable system in my game that's supposed to save but when I made it in a table and did it so the parts in your player get the colorfromrgb it doesn't save in the table, I even added a color3value... | 118638 | ||||||||
1 | How would you make a GUI visible only when touching a brick? | 281762843 | Pitched_mobile | 146 | 2020-11-23 16:26:33 | <p>title explains it all,
i want to make a GUI appear ONLY when they are touching the brick
so the moment they leave the brick the GUI disappears
anyone know how?</p>
| 116209 | 2 | 106642 | 0 | 103833540 | deeskaalstickman649 | 358 | 2020-11-23 17:39:40 | <p>Use <code>Touched</code> and <code>TouchEnded</code> events. I suggest using a LocalScript. <code>Touched</code> fires whenever and the hitbox of the part provided and another hitbox overlap. In other words, the <code>Touched</code> event fires when the part gets touched by another object. <code>TouchEnded</code> fi... |
0 | I'm trying to make it so you can only do an ability when you are holding an item, but it won't work? | 264630904 | DriBowser | 49 | 2021-12-24 05:48:22 | <p>Ok, so I am trying to do an ability where you can stop time only when you are holding a sword. So, here is the problem. It works fine the first time before I pull out my sword, when you press the button, it will only do it when you are holding the sword. But after, even when you aren't holding the sword, it still st... | 128440 | 2 | 116331 | 0 | 577417073 | AProgrammR | 378 | 2021-12-24 09:39:27 | <p>Try rewriting your code just a bit like this.</p>
<pre class='brush: lua'>local UIS = game:GetService("UserInputService")
local tool = script.Parent
local player = game.Players.LocalPlayer
local enabled = false
local remote = game:GetService("ReplicatedStorage"):FindFirstChild("TimeStop")
tool.Equipped:Connect(funct... |
1 | How to fix RightHand is not a valid member? | 1310507606 | ItzSulfonic | 61 | 2021-03-11 19:14:51 | <p>I'm getting the error RightHand is not a valid member of Model "Workspace.ItzSulfonic - line 4
R6</p>
<pre class='brush: lua'>local DB = false
game.ReplicatedStorage.PunchEvent.OnServerEvent:Connect(function(plr,Touch)
plr.Character.RightHand.Touched:connect(function(hit)
if hit.Parent ~= plr.Character t... | 121205 | 2 | 110437 | 1 | 226832508 | MattVSNNL | 614 | 2021-03-11 19:32:59 | <p>The right hand has a space in it so if you wanted it as a right-hand use this code!</p>
<p>Sorry it didn't work for you so I fixed it</p>
<pre class='brush: lua'>local DB = false
game.ReplicatedStorage.PunchEvent.OnServerEvent:Connect(function(plr,Touch)
plr.Character:WaitForChild("Right Hand").Touched:connect(f... |
2 | What are square brackets ([]) and hashtags (#) used for? | 8102267 | pokemonpokemon64 | 10 | 2014-12-06 20:30:58 | <p>So while looking through morph scripts I found this:</p>
<pre class='brush: lua'>function onTouched(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("Arm1") == nil then
local g = script.Parent.Parent.Arm1:clone()
g.Parent = hit.Parent
local C = g:GetChild... | 13032 | ||||||||
1 | DataStore Limit and Monitor? | 25691148 | FromLegoUniverse | 264 | 2014-02-27 23:31:10 | <p>Is there amount of data the DataStoreService can hold, and if there is, any way to monitor how much data is used?</p>
| 339 | ||||||||
1 | How to get a game name from the Roblox api? | 38048777 | UniverseAxis | 24 | 2017-07-10 23:43:06 | <p>I've tried this but it does not work and just says the link is not trusted or something.</p>
<pre class='brush: lua'>PlaceId = game.PlaceId
HttpServ = game:GetService('HttpService')
GAsync = HttpServ:GetAsync('https://api.roblox.com/Marketplace/ProductInfo?assetId='..PlaceId,true)
Info = HttpServ:JSONDecode(GAsync)
... | 45097 | 2 | 46070 | 1 | 817067 | XAXA | 1569 | 2017-07-11 00:00:05 | <p>There's <a target="_blank" href="http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService">MarketPlaceService</a>, which has <a target="_blank" href="http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/GetProductInfo">GetProductInfo</a>. This may be (EDIT: is exactly) what you're looking f... |
0 | Learning Lua ? | 42849143 | neonyayaunbanner | 0 | 2014-04-15 07:48:48 | <p>Im looking for a good place to learn lua sadly I was learning from Lua Learners but it got shut down.
I know most popular game creators found out from free models but thats not really my thing any good sites ?</p>
| 1556 | 3 | 2083 | 0 | 1679348 | MyLifeHope | 5 | 2014-04-15 08:27:53 | <p>The wiki, YouTube, Google.</p>
|
1 | Is there object destructuring in Lua? [Quick question] | 474299468 | zeyadtota3 | 7 | 2021-09-21 05:21:20 | <p>I dealt with many programming languages before and in almost all of them we had the concept of object/array destructuring which saves me tons of time and lines fo code, if you don't know what this is then basically say i have object</p>
<pre class='brush: lua'>local obj = {
name = 'something',
lastName = 'so... | 127588 | ||||||||
2 | How to make a brick that makes you slower when you touch it? | 25913429 | 123bbz | 0 | 2014-04-15 02:27:24 | <p>I'm trying to make a game where you must dodge blox being hurdled at you. One of
The blox would have an ability where it slows you walking speed down for a short
Amount of time. Can someone please help me!</p>
| 1452 | ||||||||
0 | end statements are having an error? | 1222281551 | botw_legend | 452 | 2020-05-29 03:56:30 | <pre class='brush: lua'>local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(plr)
local success, message = pcall(function()
local haspass = false
local gamepassID = 9794050
haspass = MarketPlaceS... | 104708 | 2 | 96584 | 1 | 24442377 | laurenbtd5 | 364 | 2020-05-29 04:45:27 | <p>Remove the end that doesn't have the parenthesis</p>
|
0 | What is this Roblox Studio bug, why I cant resize or reposition anything? | 1644124176 | BlackFateX | 19 | 2020-11-05 12:50:51 | <p>Hello Guys!
Im experiencing a bug at roblox studio. Sometimes I need to open roblox studio 5 to 10 times, just to work.
When I open it, and got into it, it is just bugging. I can click at the size or position changer tool at the top left, but it just bugging, I linked a picture, you can see it if you want.
I cant re... | 115380 | 1 | 105986 | 0 | 742380603 | KripticalYT | 100 | 2020-11-05 14:00:48 | <p>This happened to me a lot of times, I simply go to File > Open From Roblox (or Ctrl+Shift+O) I then proceed to pick the game I want to go to.</p>
|
0 | Datastore script wont save data? | 137521187 | YourAverageMyth | 45 | 2022-07-27 21:14:29 | <p>I've been working on this for like 5 days and can't figure it out because I have tiny brain. I've asked for help here multiple times but no matter what I do it won't work. I know the saving won't work because the data loading works completely fine.</p>
<p>Here's the code I have:</p>
<pre class="brush: lua">-- Writte... | 130971 | ||||||||
0 | [SOLVED]How would I make this script work? | 5522767 | rabidhalofan12345 | 55 | 2014-12-19 01:55:22 | <pre class='brush: lua'>GUI.Button1.MouseButton1Click:connect(function()
a = a + 1
script.Votingstatus1.Changed:connect(function()
a = votingvalue1.Value
print(votingvalue1.Value)
end)
end)
</pre>
<p>I've been trying to add <code>a</code> to the string's <code>Value</code> using a GUI button... | 13398 | 1 | 16453 | 1 | 13667373 | EzraNehemiah_TF2 | 3552 | 2014-12-19 03:06:08 | <pre class='brush: lua'>local a = 0 --or 1 or 2 or etc.
GUI.Button1.MouseButton1Click:connect(function()
Votingstatus1 = a + 1
script.Votingstatus1.Changed:connect(function()
a = votingvalue1.Value
print(""..votingvalue1.Value.."")--I dunno if this is needed or not but just to be safe?
end)
... |
0 | Scripting Cameras | 7016274 | Dietcoke101 | 0 | 2014-02-17 06:21:57 | <p>For my game, I really wanted to build a GUI that manipulates the camera so that it shows the map and the person would have to click a text box to continue. I know it would have to use the scriptable property of the camera in conjunction with the PlayerAdded event, but I'm really not quite sure how to go about it fro... | 25 | ||||||||
0 | error with my script It keeps saying string expected got nil)on line 34, can someone help? | 471987892 | Codex_Innit | 0 | 2022-06-20 11:02:06 | <p>Here is the script</p>
<pre class='brush: lua'>local HttpService = game:GetService("HttpService")
local Webhook = {}
Webhook.__index = Webhook
function Webhook.new(name, team, timeAmount)
return setmetatable({
playerName = name,
playerTeam = team,
timeTaken = timeAmount,
}, Webhook)
e... | 130416 | ||||||||
0 | Why can't I interact with buttons outside a frame? (screenshot included) | 1178271435 | Dem0nMeme | 11 | 2022-09-19 14:26:50 | <pre class="brush: lua">invis = -- i can't find the button i want to make invisible
script.Parent.MouseButton1Click:connect(function()
invis.Visible = false
end)
</pre>
<p><a target="_blank" href="http://imgur.com/a/2Le7x8d">https://imgur.com/a/2Le7x8d</a></p>
| 131675 | ||||||||
0 | How do I check if a certain item is in a player's inventory? | 118943708 | KingCheese13 | 21 | 2018-12-23 02:11:07 | <pre class='brush: lua'>local Spawner = Vector3.new(157.324, 0.974, 26.163)
local Clicker = script.Parent
local ObjectSpawn = script.Parent.Parent.Spawn
local debounce = false
Clicker.MouseClick:Connect(function(player)
if not debounce then
debounce = true
local Backpack = player:FindFirstChild("Backpac... | 72772 | 1 | 68817 | 0 | 27500847 | Rheines | 661 | 2018-12-23 05:46:43 | <p>You only spawn Cardboard because you're comparing Obj (which is a table) to a string, which will be false. On the else statement, you finally set Object to the Cardboard, so it will always spawn the cardboard. You can also use a for loop to reduce the number conditionals that you have to write.</p>
<pre class='brush... |
0 | How do I make a persons chat there team color? | 23665695 | EmperorF | 0 | 2014-04-16 10:27:38 | <p>Okay so say I have this:</p>
<pre class='brush: lua'>function UpdateOldLabels(Parent)
for i,v in pairs(Parent:GetChildren()) do
if v.Name:sub(1,4):lower() == "line" then
local LineNumber = v.Name:sub(5)
if LineNumber == "12" then
v:Destroy()
else
... | 2118 | ||||||||
0 | I am able to see through walls, I don't want that to happen? | 22502080 | lolkid007 | 43 | 2018-04-19 14:28:36 | <p>I've connected the player camera to a part that it would focus on, but the only problem is the camera is able to phase through all walls of any thickness, is there a way to prevent this or do I need to add anything extra to my camera script?</p>
| 57080 | ||||||||
0 | Data store doesn't seem to work "DataStore request was added to queue" "? | 211679866 | Pikachu_123456789012 | 0 | 2022-08-01 19:37:49 | <p>DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 909130723
is the error (i know that even this the error in most cases the data store saves but it doesnt seem to now)</p>
<p>this is the code</p>
<pre class='brush: lua'>local DataStoreSer... | 131048 | ||||||||
0 | Why is my Roblox studio crashes when i click the part? | 1122312651 | totosimamora608 | 61 | 2021-08-13 04:13:34 | <p>so i want to make a part that if you click it a textlabel in another part visible
but when i click it my roblox studio crashes</p>
<p>this is my script:</p>
<pre class='brush: lua'>local Text = game.Workspace.CLICKTHIS.SurfaceGui.TextLabel.Visible
function OnClicked()
if OnClicked() then
wait(3)
... | 126421 | 1 | 114908 | 1 | 244452876 | JesseSong | 3916 | 2021-08-13 07:35:27 | <h2><strong>Problem:</strong></h2>
<p>The error is caused by a <code>stack overflow.</code> On your function <strong>onClicked</strong>, a recursion is happening which never ends or repeat.</p>
<p><strong>What is a stack overflow?</strong></p>
<p>A stack overflow is a problem faced when using stacks. It occurs when the... |
0 | How to use TestService better? | 11808841 | blowup999 | 659 | 2023-03-20 21:00:52 | <p>Never really used tests, so I figured I might as well start.</p>
<p>Easiest way to run tests seemed to be to go into CommandBar and call game:GetService("TestService"):Run()</p>
<p>This works great, except then I'll change the script as the tests fail and the next time I call TestService:Run() it will still use the ... | 133218 | ||||||||
3 | How does ParticleEmitter work in scripting? | 27572935 | Slazerick | 55 | 2015-04-25 21:00:52 | <p>The new ROBLOX ParticleEmitter was recently added to ROBLOX Studio but after experimenting with it I came up with a very big question, some properties of the ParticleEmitter for example Size use the Graph where you can put different values and "envelopes" but... how would you do this using a Script? I know there's N... | 17001 | ||||||||
1 | This is not a question but can someone explain to me what does a pcall do? | 184542664 | SincereMaster_360 | 5 | 2022-06-17 00:47:54 | <p>..................................................................</p>
| 130375 | ||||||||
0 | How do I revive/respawn dummies after they die? | 944642518 | XbloxKing21 | 0 | 2021-01-12 17:57:36 | <p>I need to respawn/revive a dummy but don't know-how. Could someone push me in the right direction?</p>
<pre class='brush: lua'>repeat
if game.Workspace.Dummy1.Humanoid.Health < 100 then
game.Workspace.Dummy1.Humanoid.Health += 100
end
wait(0.15)
until true == false
</pre>
| 118598 | ||||||||
1 | Accessory Being Worn By A Character When It's Not Worn By Anything? | 353632707 | SuperSM1 | 67 | 2022-11-18 02:10:32 | <p>This error/warning just doesn't make sense</p>
<p><code>AddAcessory failed: Accessory is already being worn by another character.</code></p>
<p>No. The accessory is freshly cloned and not being worn by anything.</p>
<pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(plr)
local clone = game.Replica... | 132305 | ||||||||
0 | What is wrong with this script? Changing the different things in a model when touched by a tool | 118061211 | jacksworld2808 | 15 | 2020-04-19 09:59:02 | <p>I am trying to make a coffee system, meaning that I get coffee beans from the machine, then go to the pot and put the beans in, then I can get a cup and touch the pot to put coffee in it.</p>
<p>I'm at the stage of putting beans into the pot however I don't know what is wrong with this script.</p>
<pre class='brush:... | 99848 | ||||||||
0 | How do I check if player is falling down? | 585180878 | poggerss_u | 0 | 2022-10-02 23:21:43 | <p>So, Im making a game about jumping and I want to set the gravity to a number when the player is ascending after jumping and set another gravity for when the player is descending, so It doesnt take too long for the player to land again.</p>
<p>This is the part of the script I need help with</p>
<pre class='brush: lua... | 131787 | ||||||||
0 | Arrange the order of the tools in a player's backpack? | 3807724 | Le_Teapots | 913 | 2018-04-05 03:29:00 | <p>Is there a way to set the order of the tools in a player's backpack via a script?</p>
| 56243 | 2 | 54999 | 0 | 87138498 | cabbler | 1942 | 2018-04-05 13:04:25 | <p>Tools are sorted by the order they arrive to the backpack, then manually if chosen. So your best option would be to remove all tools then instantly parent them back in the order you want.
For example, alphabetical order:</p>
<pre class='brush: lua'>local tools = player.Backpack:GetChildren()
for _,v in ipairs(player... |
0 | How do I change text on a StarterGui? | 742610371 | redchris999 | 4 | 2019-07-27 23:41:29 | <p>Hello All</p>
<p>I'm stuck with trying to change the text label in the starter gui. The text label sits in the following hierarchy</p>
<p>Text label is child of a frame
The frame is the child of a screengui
The screengui is the child of the Starter Gui</p>
<p>I'd like the text in the text label to change when the pl... | 84562 | 2 | 78493 | 0 | 354036777 | MaximussDev | 86 | 2019-07-28 07:24:06 | <p>So basically, the StarterGui performs in a way which is like saying, “these are my starting GUIs when I spawn.” If you change the text in the ScreenGui, when it is in StarterGui, it will only give new players that, and all of them.</p>
<p>The way of doing this is by getting PlayerGui. PlayerGui is the StarterGui, fo... |
0 | My gui is not enabling on tablet devices, why? | 1522202318 | NathanBlox_Studios | 212 | 2020-08-01 09:24:25 | <p>I made a script to check if a player is on mobile, pc or tablet. The Pc works fine, so does the mobile, but the tablet does not.</p>
<p>My script:</p>
<pre class='brush: lua'>local UIS = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
if UIS.TouchEnabled and not UIS.KeyboardEnabl... | 110451 | ||||||||
0 | How to fix Missing Argument or nil for player? | 118916341 | awesomemode14 | 68 | 2019-10-07 23:44:45 | <p>Missing Argument or nil (line 3) , take a look:</p>
<pre class="brush: lua">local owner = script.Parent.Parent.Owner.Value
local player = game.Players.LocalPlayer
while true do
wait(0.1)
if game.Players:FindFirstChild(owner) == owner then
player:Kick()
print("yay")
else
print("non... | 88498 | 1 | 81977 | 1 | 151702995 | RealTinCan | 217 | 2019-10-08 00:05:51 | <p>If you are trying to kick a player when they join a server <em>(Like a ban list)</em> then you're doing it wrong. You are looking through the <strong>LocalPlayer</strong> for the player named in the value owner. Meaning your not looking at all the players in the server.
You would use a <a target="_blank" href="http:... |
0 | Script lacking permission cannot class security check? | 372313609 | CjayPlyz | 643 | 2018-09-22 04:11:16 | <p>I was trying to make a script that when a character was added in the game it would teleport it in a checkpoint but i kept getting an error i don't know what was wrong with the script.</p>
<p>Script :</p>
<pre class='brush: lua'>game.ChildAdded:Connect(function(Character)
if Character.className == "Player" then e... | 67716 | 1 | 65018 | 0 | 17217178 | ozzyDrive | 665 | 2018-09-22 09:34:03 | <p>You are attempting to index a RobloxLocked object, most likely the <a target="_blank" href="http://wiki-origin.roblox.com/index.php?title=API:Class/RobloxReplicatedStorage">RobloxReplicatedStorage</a> service.</p>
<p>You see, not all objects (including services) exist when the scripts are being executed. I ran this ... |
0 | Value status doesn't change? | 282084648 | CoolBlueJay000 | 6 | 2021-01-13 01:36:19 | <p><strong>(This is a normal script, not a LocalScript)</strong></p>
<p>Okay so, I'm trying to make a script so that you can click a gas can and it changes your value, if your value is changed, you can fuel something. I put this script in StarterCharacterScripts so that it creates a value when the player joins. Code:</... | 118617 | 2 | 108494 | 0 | 91205701 | EpicScarGaming121 | 20 | 2021-01-13 02:00:38 | <p>Several things wrong here. First, you can't use localplayer in a server script. Second, i'd recommend putting the first script into serverscript service.</p>
<p>Try this script out and see if it works</p>
<p><em>put this script in serverscriptservice</em></p>
<pre class='brush: lua'>game.Players.PlayerAdded:connect(... |
0 | How to Make a Space Warp Gate? | 1683254402 | gta_12344567890 | 7 | 2020-06-09 02:09:16 | <p>Hello Again could someone help me make a space warp gate like a teleport portal with those cool effects that neither in the movies or next thanks.</p>
| 105822 | ||||||||
0 | Why won't anything happen when i click the button? | 1752724383 | Xyternal | 145 | 2021-06-07 16:30:33 | <p>So I was experimenting with remoteEvents, and I was trying to make it so everytime the player clicks the button, he gets one point. But I get multiple errors doing so. Here is my local script</p>
<pre class='brush: lua'>local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStor... | 124171 | ||||||||
1 | How would I make a Tycoon Saving Progress and Money? | 1781946098 | SynnDC | 8 | 2021-04-04 09:10:58 | <p>So I'm making a tycoon game with a bit of scripting experience. I do get that you can use Data Store but I really don't get it. It could be awesome if someone helped me out a bit. I'm using Zednov's Tycoon Kit for this tycoon game. If you need the scripts, just ask me please.</p>
| 121996 | ||||||||
1 | How to make a custom kick message? | 261477936 | EnzoTDZ_YT | 275 | 2020-02-17 20:36:54 | <p>I want to make a kick message so if the game stops it says <code>Server Has Been Stopped.</code> and not <code>You were kicked from this game: Server Has Been Stopped.</code> i am unable to get this to happen can i get some help thanks! Code i own</p>
<pre class='brush: lua'> elseif m:sub(1, 6):lower() == "/stop ... | 94750 | ||||||||
0 | Do values not have a .Changed event? | 78280248 | Wayyllon | 170 | 2020-11-04 00:55:49 | <p>I was anticipating on using a .Changed event to detect a Bool Value changing to true but it cant find a .Changed event inside of the Value?</p>
| 115315 | 2 | 105930 | 4 | 51344642 | darmantinjr | 169 | 2020-11-04 01:10:08 | <p>To put it simply, <strong>yes</strong>, you can detect changes from a Boolean value.</p>
<p>There are multiple reasons why you could be having trouble detecting changes from a Boolean:</p>
<blockquote>
<p>Are you changing the Boolean value from the client, and then trying to detect a change signal on the server?</... |
1 | Why won't this textbutton make another textbutton visible? | 238838551 | PadmeOragana | 41 | 2020-04-04 23:33:27 | <p>Okay, so I'm working on a game and I'm trying to make this button make another button visible. It was working splendidly until I made the button that I want to turn visible bigger, and it broke for some reason. I tried making the button visible to make sure that you <em>can</em> see it, and you can, it's just the sc... | 98138 | 1 | 90633 | 1 | 16881175 | spot6003 | 64 | 2020-04-05 03:03:38 | <p>Ok so, this is a common mistake that newer scripters make. I myself made this mistake when I first started. This script is editing the gui in <strong>StarterGui</strong> while what the player sees is located in the player folder in <strong>PlayerGui</strong>. You will need to use Remote Events to communicate with th... |
0 | Having an issue with the sounds of a gun, does anybody know how to fix this? | 1314599390 | NuggetHasJoined | 7 | 2021-02-07 14:37:59 | <p>I'm currently working on a game, and the gun in the game works fine, except the sounds only play for the character shooting for the gun. The script is currently a LocalScript, does anybody know how to fix this?</p>
<p>Here is the script:</p>
<pre class='brush: lua'>local gun = script.Parent
local gun_sound = gun.Han... | 119771 | ||||||||
1 | How do i make a weapon that poison? | 1973099835 | G4BR13L_progamer123 | 5 | 2022-09-30 18:27:56 | <p>Hello Im trying to make a weapon that other than deal normal damage it deals like a poison damage like one damage every second for 10 seconds</p>
| 131760 | 1 | 119018 | 0 | 111567127 | Jay123abc2 | 241 | 2022-09-30 19:42:00 | <p>I don't know if you're asking for the whole gun script, or just the poison damage part. Due to this, I will link a video for making a working gun and I will go over the poison script.</p>
<p>In the part off the script where it will deal damage, so if the bullet successfully hit a player it will need to loop through ... |
1 | Why does raycasting detect random stuff? | 849198397 | jdm4llfem8 | 94 | 2021-02-22 17:37:25 | <p>I have a part that's in a moving model and a raycast that detects the bottom. Sometimes it just detects random stuff, like the parts ontop or the parts on the side even tho i set it to detect stuff from the bottom, and when the part is in another part it detects literally nothing. How do I go around fixing this?</p>... | 120520 | ||||||||
0 | How do I lock the player's mouse? | 467337150 | XDvvvDX | 186 | 2020-06-23 10:57:55 | <p><strong><em>Hello. I've seen many games locking the player's mouse, but I don't know how. Like they enable shift lock to the player without him pressing left shift. I would absolutely accept the helpful answer!</em></strong></p>
| 107166 | ||||||||
0 | How to I make a MODEL disappear and reappear using ClickDetector? | 19096829 | Laserpenguin12 | 85 | 2014-07-18 17:10:32 | <p>How do I make a model disappear and reappear using ClickDetector?
This is what I did on the first script, then the second script</p>
<pre class='brush: lua'>function click()
script.Parent.Parent["Moving Office Chair"].Transparency = 0.8
script.Parent.Parent["Moving Office Chair"].CanCollide = false
script.Parent.Cli... | 8317 | ||||||||
0 | My Object is not cloning but no errors occur. What have I done wrong in my script? [SOLVED] | 1169362290 | iiMxtt_Destinyii | 58 | 2021-04-05 16:10:01 | <p>Object is not cloning but no errors occur. It just doesn’t clone anything.</p>
<pre class='brush: lua'>function TestService:Spawn(Player, Weapon)
if Weapon ~= Items.IDArray[Weapon] then
game.ReplicatedStorage.SuccessMessage:FireClient(Player, "? Successfully found "..Weapon.." with ID "..Items.IDArray[We... | 122037 | 2 | 111155 | 1 | 812747954 | piximentility | 37 | 2021-04-05 16:18:14 | <pre class='brush: lua'> Clone.Parent = game.Workspace
-- :D
</pre>
|
0 | Why cant I compare leaderstats with a local script? | 1527823663 | kickoff127 | 15 | 2020-11-26 17:03:12 | <p>I am trying to make a button that you can buy something but only if you have a certain amount of "Deaths"</p>
<p>here's my script:</p>
<pre class='brush: lua'> if game.leaderstats.Deaths.Value == 1 then
game.Workspace.Parent.StarterPlayer.CharacterWalkSpeed = 70
end
</pre>
<p>Can you help me?</p>
| 116370 | 1 | 106778 | 0 | 644099692 | Gameplayer365247v2 | 1001 | 2020-11-26 20:00:57 | <p>leaderstats is not a valid member of game, if you have output open, you will see this error
the fix for this is to check the player leaderstats if you even have one by doing this
(im assuming you already got a player variable for the player trying to buy something)</p>
<pre class='brush: lua'>if player.leaderstats.D... |
0 | Need Scripting help on roblox! -Murder game issues with teleporting players to map-? | 137883343 | ChrisThrRoblox1234 | 12 | 2018-08-21 12:33:16 | <p>I'm making a murder game and I have an error. 'Argument 1 Missing Or Nil'
The error part is at the part where it teleports them to the map.
I am an experienced Roblox scripter but I have never seen this error.
If any of you know this error or know a fix please reply below with the fix.
Hope you can help me with this... | 65940 | 2 | 63702 | 0 | 286997127 | TheDev321 | 37 | 2018-08-21 13:12:06 | <pre class="brush: lua">if putmapsinworkspace == true then
local map = Maps:FindFirstChild(mapnamethatwaspicked)
map.Parent = MapFolder
elseif game.Workspace:FindFirstChild(mapnamethatwaspicked) or MapFolder:FindFirstChild(mapnamethatwaspicked) then
MapFound = true
-- This would not work, because you have n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.