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
ServerHandler:25: attempt to index nil with Instance ?
1507223621
BabouchL
0
2022-11-15 17:36:52
<p>so im trying to make a skill framework but whenever i try to fire the inputended i receive a trying to index nil with instance on the inputended event</p> <p>Server Handler script</p> <pre class='brush: lua'>local RS = game:GetService("ReplicatedStorage") local ServerRemote = RS.Remotes.Server local Inputs = require...
132286
1
Can someone help me about my tween service issues, please?
147178737
Daddy_Francisco
2
2023-03-11 15:21:03
<p>i tried making a tweening pedestrian's car but i tried but it rotates how do i shut the rotation down?</p> <p>i can't even fix this thing by myself here's the code:</p> <pre class='brush: lua'>local TweenService = game:GetService("TweenService") local part = script.Parent local cframelocation = script.Parent.Parent....
133177
2
120250
0
178628425
Jac_00b
157
2023-03-11 16:11:53
<p>I actually had this exact same problem several days ago, but I managed to find a fix. Inside of the Goals, instead of making a separate one for Orientation, you need to add the orientation to the CFrame goal. To do this, you can use <code>CFrame.fromOrientation()</code>.</p> <p>Assuming that you want to keep the ori...
0
How to use math.random for GUI buttons?
523763305
MrMonthh
4
2020-09-13 05:52:18
<p>Hi there. I'm trying to make a radio where you can listen to various different radio stations. The radio scripts are stored in the workspace, and I'm trying to make so you can switch radio stations. My scripts for the radio station don't work though.</p> <pre class='brush: lua'>function onClicked() script.Parent...
113106
0
How do i color a whole model within a script?
1593155829
OreyTheOre
19
2021-02-22 06:32:20
<p>Hey there, i was wondering how do i color a whole model within a script?</p> <p>Please tell me where the script should we, what type of script. And the script, thank you!!</p>
120501
2
109875
0
557740900
denbra37
17
2021-02-22 07:10:35
<p>I'm super noob at scripting but I think you can do :</p> <pre class='brush: lua'>local model = script.Parent local children = model:GetDescendants() --first we get the descendants for i , v in pairs(children) do --we loop through them if v:IsA("BasePart") then -- we check if it's a part v.Color = color3....
0
How can i edit this inventory system script so it puts all of the purchased tools??
1288796265
coolflamingoiscool
7
2020-07-31 22:13:51
<p>Im trying to make a inventory system for a simulator im working on but this script only puts the tool that a player has equipped in the inventory. How can i make it so it puts all of the tools a player has purchased. I also want it so it puts the backpack/storages (accessory) in the inventory. Can anyone help me? He...
110413
0
Physics in Lua?
49960495
ScriptNHelper
5
2014-02-27 07:17:53
<p>I know many people say there are physics in Lua. What does that mean? Like the physics in science? Can you provide some examples too please?</p>
330
2
612
1
19178967
TheMyrco
375
2014-02-27 14:31:48
<p>Do not forget that the gravitational force is exactly 196.2.</p> <p>So if you put a BodyForce object into a huge part and set the y value of the force to <em>196.2x</em> whereas x equals the mass of the part, then it will stay, float.</p> <p>This can or cannot be of use, that's upto you. One last thing, you can easi...
0
How do you see how many parts are in an game?
539909602
Retallack445
12
2020-09-15 22:29:37
<p>i want to make a TextLabel that lets you see How many parts are in an game . is it even <strong>POSSIBLE</strong>?</p>
113205
2
103930
0
468944525
CreationNation1
329
2020-09-15 23:11:59
<p>Yes, this is in fact possible. The way you could do this is to create a table containing all the parts found. For this to work, simply redefine the text label that you want to show the part count in.</p> <pre class='brush: lua'>local textLabel = script.Parent local parts = {} for a, b in pairs(game:GetDecendants()) ...
0
[SOLVED] How do I make this pathfinding AI, create path more often?
572277495
tommymcoco1
39
2021-12-19 09:59:10
<p><strong>TO MAKE IT MORE SIMPLE HERE IS A MODEL OF THE AI:</strong></p> <p><a target="_blank" href="https://web.roblox.com/library/8293330612/Test">https://web.roblox.com/library/8293330612/Test</a></p> <p>What could be happening is in the code there is a for i, v in pairs()waypoints do this is causes it to repeat wa...
128319
1
116248
3
158811
TGazza
1306
2021-12-20 12:23:34
<p>Just re-wrote your AI with something I had in storage.</p> <p>Code:</p> <pre class='brush: lua'>local Me = script.Parent local MyBase = Me:WaitForChild("HumanoidRootPart",10) local Humanoid = Me:WaitForChild("NOOB",10) Me.PrimaryPart:SetNetworkOwner(nil) local Index = 3 -- this is needed to start from 3 otherwise th...
0
Only turns green when opponent's not holding a sword?
56684765
Wrongmistake
0
2014-04-17 12:27:12
<p>So I made a script, that turns green when a player touches another player, but the problem with it is that it will only turn green when a player's not holding a sword. It's supposed to change the meshes color to green whether the player's holding a sword or not. Could somebody fix this?</p> <pre class='brush: lua'>h...
2416
0
(More answers welcome) How does one actually learn to professionally script?
31504923
rabbi99
520
2020-04-05 14:25:35
<p>It's probably a myth that professional Roblox scripters know everything to script. Which could be true, but also very false. I'm a learning scripter that gets a lot of errors and confusion while scripting. How do you professional scripters know how to script so well? I've watched the entire Peasfactory tutorial (I c...
98202
2
90676
0
244452876
JesseSong
3372
2020-04-05 14:31:13
<p>I will suggest having a notebook and writing everything down. This makes you remember what you've learnt also if you want to know how to script anything off by heart. YOU MUST first learn the basics. 1.Memorilise everything you've learnt try to test your self. And 2. Follow all youtubers and try to copy them at the ...
0
How would I script it so when a press mousebutton1 when holding a tool it turns a surface light on?
1605120315
Nuzixa
4
2020-08-02 12:45:27
<p>How would I script it so when you hold a tool, and press mousebutton1 it changes the surfaceLight (In the tool) on, and when you press mousebutton1 again it turns it off?</p> <p>Thanks!</p>
110537
2
101533
0
131470756
Pupppy44
671
2020-08-02 13:36:55
<p>You could have a variable called <strong>Toggled</strong>. Here's an example:</p> <pre class='brush: lua'>local Toggled = false -- Here's the Toggled variable local Tool = script.Parent -- Assuming that the script is in the tool function Activated() -- Function to detect if a player clicks mousebutton1 if Toggled ==...
0
why doesnt the animation stop playing in this script when the key is depressed?
40807098
coda6000
2
2022-08-04 18:20:17
<pre class='brush: lua'>local userInputService = game:GetService("UserInputService") local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded local Anim = Instance.new("Animation") --this is for any inputs at all userInputService.InputBegan:Connect(function(input,GameProcessed...
131098
2
118430
1
114964274
Rogue_Ram
40
2022-08-05 02:17:05
<p>You are trying to make a new animation play when the player releases E instead of stop the currently playing one. To fix this you need to place a variable at the top to store the playing animation and stop it when the player releases the key as so:</p> <pre class='brush: lua'>local userInputService = game:GetService...
1
How do I display a NumberValue on a SurfaceGUI?
231105564
WhatsSamYT
5
2021-02-22 00:12:31
<p>I'm making a gameshow and wanted the stands where the contestants are to have their points displayed. I made the stands and added a simple Surface GUI and TextLabel. Then inside the TextLabel, I added this local script code, but it didn't work.. Please help.</p> <pre class='brush: lua'>while wait(0.01) do script.Par...
120488
0
ModuleScript changes not replicating to client?
677278792
NickIsANuke
217
2020-08-01 17:56:52
<p>I have a module script in ReplicatedStorage that holds data about the hurricane a server script generates. The module's code looks something like this:</p> <pre class='brush: lua'>data.HurricaneActive = false data.HurricaneName = "" data.HurricanePath = 0 data.HurricanePosition = Vector3.new() data.AverageWindspeed ...
110485
0
How do I fix this? Gear from ServerStorage won't be put into players backpack after proximityPrompt
174504830
pokemonzizzle8383
6
2022-10-07 00:58:00
<p>Hello! I am trying to make a sneaky sort of easter egg for my game, Yet it has been quite a while since i've done this sort of scripting. Anywho I have a proximity prompt on a meshpart, which when done will make the part disappear, play a sound and then give you a special gear, however when trying to put the gear in...
131817
0
Why doesnt this script work as a script but it does as a local script?
647598508
proudCdthekitten
16
2020-09-13 09:29:58
<pre class='brush: lua'>script.Parent.Equipped:connect(function(m) m.Button1Down:connect(function() script.Parent.Parent.Torso.Transparency = 1 end) end) </pre> <p>Im trying to have it visible to everyone which can work in a script (maybe im bad at scripting). but it doesnt work in a script. It does work in a l...
113112
0
How to make a audio start playing?
1983974344
superaceCZ
3
2021-02-23 15:56:39
<p>Hello can someone tellme how to make an audio start playing like wait (5) <em>now i need the script what make a audio playing</em> i tried wait (5) play (worskpace.Music.NukeIgnition) but it not work also the nukeignition is not real its only renamed original is Portal (a)</p>
120566
1
109930
0
2064787945
Punctist
120
2021-02-23 17:43:36
<pre class='brush: lua'>wait(5) workspace.Music.NAMEHERE:Play() </pre>
0
Best way to wait for all players to load in then do something?
230520276
retrobricks
162
2018-10-09 05:13:36
<p>I need a way to wait for all the players to be loaded in then do my stuff.</p> <p>This is what I have at the moment:</p> <pre class='brush: lua'>local RepStorage = game:WaitForChild("ReplicatedStorage") local Remote = RepStorage:WaitForChild("GameRemote") --Wait for players local WaitingPlayers = game:GetService("Pl...
68641
1
How come my money give command wont work. What's happening?
150334552
vincentthecat1
169
2021-02-21 05:21:23
<p><strong>--//Description&#92;--</strong></p> <p>I have 2 scripts. One called <strong>AdminHandler</strong> and another <strong>called Controller</strong>. I know Controller sends the data I need to send but the admin handler won't run the command. Whats happen?</p> <p><strong>--//AdminHander&#92;--</strong></p> <pre ...
120453
0
How do I organize a table of numbers from least to greatest?
676151371
rubixxman
4
2021-07-19 00:25:11
<p>What I'm trying to do is at the end of the round in my game, I want a list of every player's kills in order, but so far I only found out how to find the player with the most/least of a certain value. Any help will be appreciated!</p>
125474
1
114195
3
25483747
appxritixn
2235
2021-07-19 01:51:45
<p>There is a table method called <strong>sort</strong>. This method takes the table (t), and an optional function to provide an algorithm for sorting.</p> <p>A requirement for the <em>comp</em> function is two arguments. The function should return true when the first element should come before the second.</p> <p>An ex...
0
Passing a sound from a localscript to a module script?
55310986
hokyboy
270
2021-05-29 01:49:11
<p>The localscript</p> <pre class='brush: lua'>local Currsound = script.Parent[v.Name] MusicModule.Fadeout(Currsound) Currsound:Stop() wait(1) script.Parent.Sea:Play() </pre> <p>The module</p> <pre class='brush: lua'>local MusicModule = {} function Fadeout(Currsound) for count = 1,5 do Currsound.Volume = Cu...
123867
1
112919
1
1715522570
BeautifulAuraLover
371
2021-05-29 12:26:32
<p>Module script:</p> <pre class='brush: lua'>local MusicModule = {} MusicModule.Fadeout = function(sound) for count = 1,5 do sound.Volume = sound.Volume - 0.1 end end return MusicModule </pre> <p>Local script:</p> <pre class='brush: lua'>local Currsound = script.Parent[v.Name] local...
0
How to fix &quot;Attempt to call a string value&quot; error?
1112337243
Pejoume
11
2020-06-23 20:33:53
<p>I'm trying to make a webhook that tells people how many players are in the game and I keep getting an error. Here is the part of the script that keeps giving me errors, it triggers when a player joins the hostile team.</p> <pre class='brush: lua'> local nPlayers = game.Players:GetPlayers() local Strin...
107224
0
How to clone character, locally?
190357083
THUNDER_WOW
149
2020-07-11 02:12:55
<p>How do I make it so when a player joined their character gets cloned, locally? I know I have to use a local script but how do I actually clone the player?</p>
108749
0
What value can players have?
609694350
thedukke1
9
2021-10-09 09:20:57
<p>Im trying to add classes to my game and it will happen like this a gui pops up and you can choose class and i want when you click one of the classes you will get a value named the class thing but i dont know what value that can be used</p>
127818
0
Why is this print that I made isn't showing up in my output on a local script?
103919802
TheBuliderMC
80
2021-02-23 05:25:23
<p>(here we go again with a wacky title to avoid the spam question)</p> <p>Whenever I equip a tool, I have a print in it and it's not showing up in my output. The UI shows, but the XBox one doesn't when I simulate the XBox screen on roblox studio. If this is correct, could it be that I need to be on xbox to view the UI...
120549
2
How to figure out if the topbar is enabled?
11808841
blowup999
659
2017-10-07 01:26:40
<p>The code is in a localscript, and makes TopbarEnabled false ok, but before and after it isn't willing to print whether TopbarEnabled is currently true or false</p> <p>When I include the print commented at line 2 it breaks the pcall</p> <pre class="brush: lua">pcall(function() --print(game.StarterGui:GetCore("Top...
48438
1
how do detect when a player is touched by another player?
1073917569
Puppy_lovertheawsome
84
2022-11-08 07:56:55
<p>I am just wondering how I could detect that. I am also wondering if that is possible inside of a local script in StarterPlayer > StarterCharacterScripts. I don't know if you want the code so I will just show it and note where I want it to be able to detect.</p> <pre class='brush: lua'>game.Players.LocalPlayer.Charac...
132191
1
119401
0
1060251348
sergeant_ranger
184
2022-11-08 17:45:46
<p>You can detect player touching like this:</p> <pre class='brush: lua'>local player = game.Players.LocalPlayer local character = player.Character detected = {} if character ~= nil then for _, part in pairs(character.HumanoidRootPart:GetTouchingParts()) do if game.Players:GetPlayerFromCharacter(part.Parent...
0
When &quot;Vividex&quot; joins hat give won't work?
39704067
Vividex
162
2014-05-18 06:54:06
<pre class='brush: lua'>local JJ = game.ReplicatedStorage.JJ function onEnter(player) end if (player).name == "Vividex" then do JJ.Parent = player end end </pre> <p>this is probably no wear near to close of what i thought pretty much suck at scripting i put the jj hat in replicatedstorage and made a fun...
5026
0
Cloned parts not firing click event?
36818362
chook100
28
2022-08-02 20:01:51
<p>I have a game that has 2 cubes, a cube with a "2" on it and a cube with a "4" on it. If you click the cube with a "2", something will happen but if you click a cube with a "4" on it, something will happen AND the "4" cube will be replaced with a "2" cube. That new "2" cube should act like all the other "2" cubes tha...
131071
0
how to the fix cannot Class security check lacking permission 6 error?
1775753594
Not_prototype
43
2022-07-29 23:20:19
<p>the script is a server script and inside serverscriptservice</p> <pre class='brush: lua'>for i,target in pairs(game:GetChildren()) do if target:FindFirstChildWhichIsA("Humanoid") then if target.Name ~= player.Name then if (target.Character.HumanoidR...
131002
0
why do my animations not load on the humanoid?
1584535896
QuirkyAnimeBoy
0
2021-05-01 23:22:57
<p>so I have this dead by daylight-esk hook model that locks a target in place, waits a bit, and then lets them "struggle" to break the hook. there are 3 animations in place for this: hooking, idle, and struggling</p> <p>what I'm currently doing:</p> <pre class='brush: lua'>local target = script:WaitForChild(plr).Value...
123012
0
Attempt to index nil with MoveTo?
1491123686
TheEggsquidzidBoi
38
2020-06-24 12:34:29
<p>Im trying to make only select players in an array teleport to a certain location in my code here:</p> <pre class='brush: lua'>local teleport = PlayersPlaying for index = 1, #teleport do PlayersPlaying[index].Character:MoveTo(Vector3.new(176, 31.5, 635)) end </pre> <p>but it says "Attempt ...
107287
1
How can I fix strange rotation axis when using Motor6d?
5453383
ZeroBits
142
2015-04-29 02:22:06
<p>Hey, I'm trying to make a neat canopy opening effect using Motor6Ds and animations but I keep ending up with weird angles with the parts, <a target="_blank" href="http://i.gyazo.com/56d824f3c19d14c50048df14ca6d3343.png">here</a> is the model before rotation, and <a target="_blank" href="http://i.gyazo.com/4ef2435d6e...
17104
2
Why does my ROBLOX Studio constantly crash for no reason?
386632990
gmatchOnRoblox
98
2018-05-26 19:59:28
<p>It started constantly crashing for certain places for whatever reason, maybe due to plugins (which were not in use during the crashes). I'm casually scripting then out of nowhere studio crashes. Not with the casual "screen turns white and you hope it comes back" but with the little text box that looks like this:</p>...
59069
0
Kick on death?
21467784
MrLonely1221
701
2015-01-13 03:01:10
<p>How can I make my game kick someone when their health hits 0?</p>
14200
0
How to make parts thinner?
5206310
alibix123
175
2016-05-13 08:24:04
<p>I used to be able to set the FormFactor but now Roblox says it's deprecated and I can't find it in the properties of the part, so what is the new way to make a part thin?</p>
30532
1
33851
0
25923785
minerobx
0
2016-05-13 12:21:34
<p>Just before couple Roblxo Studio updates you needed to change your Part from Brick to Custom. Now you do not need it! Why? I can't answer why but just go to Model Site that is in Roblox Studio Top Hotbar. Then choose from 1 Stud to 1.5 Studs then select Resize tool select your Part that you need to make it Thinner c...
0
Score Click Gui?
55914575
McCorus
5
2014-03-02 13:49:50
<p>Alright, so here's what I'm trying to do.</p> <p>Whenever someone would click this certain brick, their 'score' in a GUI I made would go up by 1 each time they click the brick. For some reason, I cannot get this to work.</p> <p>Also, there's two TextLabels where the score is supposed to show. One is just plain white...
437
0
Is there a way to use Part:GetTouchingParts() in a for loop?
137068483
LiquidGaming
33
2020-08-17 13:14:27
<p>In a part of my script, I'm taking parts and their positions and adding them to a list (got that part done) but for some reason when I do</p> <pre class='brush: lua'>-- example code for i, v in pairs(part:GetTouchingParts()) do print(v.Name) end </pre> <p>It prints nothing, even when multiple parts are touching ...
111547
1
102385
1
126659427
VerdommeMan
1479
2020-08-17 15:21:37
<p>Yes you can use it like that in a loop, infact you can even do ipairs since its a normal table</p> <p>The reason it doesnt work is because:</p> <p><code>If the part itself has CanCollide set to false, then this function will return an empty table UNLESS it has a TouchInterest</code></p> <p><a target="_blank" href="h...
0
How can I stop an animation at a specific keyframe ?
254997657
EmilyFritz97
0
2022-06-21 01:03:08
<p>Hello, I did a punch animation and I want the punch to stop in a specific keyframe when you hold your M1 button. Please help :)</p>
130430
0
Help saving data for endings!,How i do this?
316673208
ImDragron
7
2022-05-02 22:37:43
<p>I need to save the endings or events that the player did and put a block if that player already completed that or not, something like that,but I can't think of any script to help me with that</p>
129897
0
My punching animation only works in studio may anyone help? I think it has something to do with
363680486
PizzaManLoverBoiNoah
0
2020-09-13 05:27:26
<p>local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()</p> <p>Here is the full script though:~~~~~~~~~~~~~~~~~</p> <p><code>local Player = game.Players.LocalPlayer`local Mouse = Player:GetMouse() local dmg = true Mouse.KeyDown:connect(function(key) if key == "f" then local an = script.Parent.Humanoi...
113104
0
How would I make this Raycast gun shoot in the air?
443647789
super1boom
0
2020-08-01 11:57:38
<p>So I made this gun script. It works, but only when I point my mouse to a surface and shoot. I want it to shoot when it points to the sky also.</p> <p>The script:</p> <pre class='brush: lua'>tool.Activated:Connect(function() firing = true while firing == true do local ray = Ray.new(script.Parent.barre...
110459
0
Why does assigning values to a Frame's position output the position as {0,0,0,0}?
125970229
catlimenada
15
2022-05-21 20:30:49
<pre class='brush: lua'>local btn = script.Parent btn.Parent.Contents.Position = UDim2.new( btn.Parent.Contents.posMoved.xScale.Value, btn.Parent.Contents.posMoved.xOffset.Value, btn.Parent.Contents.posMoved.yScale.Value, btn.Parent.Contents.posMoved.yOffset.Value...
130068
0
Have a script wait precisely?
2933011
Nickoakz
231
2014-04-26 17:54:49
<p>I have a countdown that counts down a hour per second. Over time, the countdown would be over 5 minutes or less then 5 minutes. Is there a way to have wait() perfectly exact?</p>
3609
1
5024
1
386992
BlueTaslem
18044
2014-04-26 19:43:01
<p>The solution is to check actual elapsed time rather than assume the previous times add up to something.</p> <p>Consider the following functions which count to ten in ten seconds:</p> <pre class='brush: lua'>function pause(time) wait(time - 0.1 + math.random() * 0.2); end -- We use this just to introduce extra --...
0
How can I send in a message in the roblox chat when a player joins?
1515217986
Joint_Ventures
5
2022-05-28 00:33:41
<p>So I've been trying to make it where when a player joins, it sends a message to the whole server saying, > Player.Name has joined the Experience! &lt; but my script doesn't work, can anyone help me? I have been using ChatService.</p> <p>I have it in ServerScriptService.</p> <pre class='brush: lua'>game.Players.Playe...
130121
0
How could I fix this dialog tool giver script? It doesn't give any tools.
332837744
pinelemongamer
19
2020-03-25 23:38:05
<p>So I've been working on a dialogue based tool giver but it doesn't seem to work. I don't know what could be wrong with it. I would love if someone could point out my errors.</p> <pre class='brush: lua'>local rs = game:GetService('ReplicatedStorage') local Coffee = rs:WaitForChild('Coffee') script.Parent.DialogChoice...
97085
0
How do I see what a player types in a textbox and see if its correct?
916435291
LuaScriptingBlox
0
2019-12-25 23:42:18
<p>So i'm making this game were there is a pyramid and you have to put a code into a text box and if you get the code correct you may pass. The only problem i have is seeing what the player typed in the text box and see if its correct.Here is my script im looking for a better way</p>
91930
0
How do I add to this value correctly?
304997552
MasonTheCreeperYT3
74
2018-04-17 01:57:01
<p>I have this script that's not working I'm trying to make a fishing game where you fish to get money but I want it to show you how many fish you collected how do I add one to a string value?</p> <pre class='brush: lua'>script.Parent.Touched:connect(function(hit) local player = game.Players[hit.Parent.Name] pl...
56979
7
Why does the length of this table = 0?
10585217
ausmel105
140
2017-02-06 22:32:14
<p>Hello all,</p> <p>I was wondering why the code below prints to be 0, am I not adding an entry to the airport.airlines table?</p> <pre class='brush: lua'>local airport = {} airport.destinations = { Zakynthos = { Name = "Zakynthos"; IATA = "ZAK" } } airport.airlines = { Airline = { ...
39847
4
How do I activate an animation when a players says &quot;anim/&quot;?
49352468
fireboltofdeath
630
2014-05-29 03:02:52
<p><strong>Here is what I have done so far</strong></p> <pre class='brush: lua'>game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(m) if m == "anim/" then --Rest of code I do not know. end end) end) </pre>
5784
0
How to combine remote events and ontouched event?
338950628
RedcommanderV2
1256
2018-01-21 13:13:18
<p>This is the sender <strong>(server script)</strong></p> <pre class='brush: lua'>-- Server script Detector = script.Parent.DetectorFront Reset = true local Players = game:GetService("Players") cameraA = game.ReplicatedStorage.cameraA Detector.Touched:connect(function(hit) local plr = hit.Parent if plr:FindFir...
52429
1
51880
3
16542699
mattscy
3720
2018-01-21 13:19:12
<p>Hit.Parent is not the player, but rather the player’s character. To get the player instead of the character, you can use GetPlayerFromCharater with the character as an argument.</p> <pre class='brush: lua'>Detector.Touched:connect(function(hit) local char = hit.Parent if char:FindFirstChild("Humanoid") then ...
0
[SOLVED] How come my custom Tool Equipping system keeps sending the same error?
150334552
vincentthecat1
199
2022-11-15 04:14:36
<p>For the past 5 hours I've been working on a Tool Equipping system, but for some reason I keep being sent the exact same Error. I think I've located the the source to the issue, but when ever I attempt to fix it never works.</p>
132283
0
I'm trying to make a frame visible my right clicking.?
293168415
Haker902c
18
2020-06-26 00:18:40
<p>This local script is in StarterPlayerScripts:</p> <pre class='brush: lua'>local mouse = game.Player.LocalPlayer:GetMouse() mouse.Button1down:Connect(function() StarterGui.ScreenGui.Frame.Visible = true end) end) </pre> <p>The frame is in screen gui that is the child of starter gui</p>
107446
2
98791
1
161262344
sean_thecoolman
190
2020-06-26 00:28:48
<p>this is easy to do as not only you can use it for this, but you can use it for click detectors and so on.</p> <p>i am assuming you are using a text button to do this, or anything relevant to that.</p> <p>you would instead put the local script into the button that is parented to the screen GUI.</p> <p>(at least, this...
1
How do i fix no property name for object error?
1775753594
Not_prototype
26
2020-12-22 16:40:37
<pre class='brush: lua'>local rp = game:GetService("ReplicatedStorage") local summon = rp:WaitForChild("Summon") local tweenservice = game:service("TweenService") summon.OnServerEvent:connect(function(player,isactive) local character = player.character local humanoid = character.Humanoid local Humrp = chara...
117537
1
107653
1
268163689
FootFungusWeirdo
198
2020-12-22 16:46:08
<p>With my experience im sure that you should write <code>transparency</code> as <code>Transparency</code></p> <pre class='brush: lua'>local rp = game:GetService("ReplicatedStorage") local summon = rp:WaitForChild("Summon") local tweenservice = game:service("TweenService") summon.OnServerEvent:connect(function(player,i...
0
How do I check if a string includes a certain phrase?
1080337
uui
25
2020-09-14 23:16:03
<p>I want to check if a variable named "custom" includes the text "http://www.roblox.com/asset/?id=" How would I go about doing this?</p>
113167
1
Works in play solo, but not online mode?
302188
Dom2d2
35
2014-04-19 16:45:06
<pre class="brush: lua">player = script.Parent.Parent thrust = game.ReplicatedStorage.BodyThrust force = game.ReplicatedStorage.BodyForce f = force:Clone() f.Parent = player.Character.Head while true do locationX = player.Character.Head.Position.X locationY = player.Character.Head.Position.Y locationZ = player.Char...
2869
1
How do i make this tool spawn randomly in a radius around the spawner?
671762386
Lhinger
5
2022-11-17 22:04:03
<p>I tried to make a spawner that spawns a tool (a pink cube) randomly in a radius around the spawner but the cube doesnt move and doesnt spawn randomly</p> <pre class='brush: lua'>--// Variables local cframeX = workspace.testSpawner.Position.X local cframeY = workspace.testSpawner.Position.Y local cframeZ = workspace....
132304
2
Playerlist not functioning properly?
15619704
NinjoOnline
1147
2016-07-12 14:31:42
<pre class='brush: lua'>local frame = script.Parent local labels = {} for i = 1, game.Players.MaxPlayers do labels[i] = frame:WaitForChild("Player"..i) end local players = game.Players:GetPlayers() for number = 1, #labels do labels[number].Text = tostring(players[number] or "") end </pre> <p><code>08:39:02.906 ...
33007
0
How can i reference Humanoid?
586997594
YandH015
9
2021-01-14 13:09:39
<p>So i'm trying to reference the Humanoid so I can damage the player upon touching something, but it doesn't work. Here is how I tried to reference the Humanoid</p> <pre class='brush: lua'>local humanoid = game.Players.LocalPlayer:FindFirstChild("Humanoid") </pre> <p>I also tried <code>local humanoid = game.Players.Lo...
118679
1
108550
0
58729054
Dovydas1118
1410
2021-01-14 13:18:52
<p>Humanoid is a child of Character. So you will need to add another hierarchy in order to get the humanoid. Also I recommend putting CharacterAdded in case the character isn't there.</p> <pre class='brush: lua'>local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() l...
0
how would i reference the player?
835155757
BRO_ITmeYO
106
2020-06-05 20:09:59
<pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(player) print(player.name "joined") if not player.Character then print("waiting for character") player.CharacterAdded:wait(); char = player.Character else char = player.Character end end) local hum ...
105463
1
97169
1
1451175629
SuAkihiro
48
2020-06-05 20:18:19
<p>to get humanoid you should do this ></p> <pre class='brush: lua'>local hum = char:WaitForChild("Humanoid") -- waits until Humanoid appears and won't be a nil value, also its "Humanoid" with capital H </pre> <p>to fix line 2 you should do this ></p> <pre class='brush: lua'>print(player.name.. " joined") -- ".." conne...
1
How do I do arithmetic with attribute?
1533246993
CountOnMeBro
51
2021-06-03 01:02:49
<pre class='brush: lua'>SecTime = game.workspace:GetAttribute("Second") while true do wait(1) SecTime = SecTime + 1 game.Workspace:SetAttribute("Second", SecTime) end </pre> <p>It gives me a error, attempting to do arithmetic at line 4. How do i fix it</p>
124019
0
Local script not changing the player's textbox?
250740876
Partykidcrazy
15
2023-01-23 21:51:46
<p>for information, ive been having a problem. a script i have to cast a definition to a textbox is not working for me. the script is below, and below that is some more information and where some things you'd ask for are located:</p> <pre class='brush: lua'>local Player = game.Players.LocalPlayer local f = Player.Playe...
132926
0
:FireClient() Doesnt Change Transparency For Gui in PlayerGui?
1680108820
JmoneyPlayzOfficial
49
2023-02-26 04:47:54
<p>what this script is supposed to do is that when the RemoteEvent is fired, the player who fired the scripts GUI (aka playergui) will change the transparency for the GUI by taking away -.25 for every GUI object listed in the script, once that repeated 4 times, the script will wait 10 seconds before kicking the player ...
133124
1
How do I make a tool &quot;locked&quot;?
10186880
wddd89
35
2014-03-05 22:53:05
<p>So, I was wondering on how to make a tool in which you can never de-tool it once you have equipped it. Even better, have it equipped from the start. Help is greatly appreciated. thanks.</p>
508
2
839
2
31265920
Azarth
3141
2014-03-05 22:56:45
<p>There's a method to force equip a tool, it's called <a target="_blank" href="http://wiki.roblox.com/index.php/EquipTool_(Method)">EquipTool</a>. It's the same thing as parenting the tool to your character.</p> <p>There's also a property in the tool called 'CanBeDropped' that you can tick off, which won't allow playe...
0
&quot;ColorSequence.new(): table expected&quot; what's this mean?
19584154
SirTottenhamcake
22
2018-07-27 18:21:14
<pre class="brush: lua">local Vom = Instance.new ("ParticleEmitter") Vom.Parent = human.Parent.Head Vom.EmissionDirection = "Front" Vom.Enabled = true Vom.Rate = 500 Vom.Rotation = NumberRange.new (0,360) Vom.Speed = NumberR...
63879
1
61958
0
177199462
sen_trix
31
2018-07-27 19:03:12
<p>Here's some stuff that can help you: https://wiki.roblox.com/index.php?title=API:ColorSequence</p>
1
Local sound played when in object?
146403383
alialan626
23
2020-07-25 13:20:23
<p>How do I make a sound play when inside of a invisible block with non collide on and end the music when the player has left the inside of the object?</p>
109926
0
Make lava rise when a text button is clicked and then reset when people are killed/dead?
374373528
furyMDT
0
2022-11-13 08:27:13
<p>So, I don’t really know how to script. I am making a floor is lava game and I have the scripting for it (like make lava rise and kill you) but when the game starts, the lava just instantly rises and doesn’t reset. Does anyone know how to make the lava start to rise when a test button is clicked and then if everyone ...
132264
0
Simple animation not playing, why??
379782887
Shounak123
449
2022-09-10 09:55:58
<p>My arm model is a Skinned Mesh. I have imported it and created a simple animation on it. For some reason, the animation just doesn't play.</p> <p>Here is the Explorer:</p> <pre class='brush: lua'>Hands vmcccm vcx AnimationController armmesh Arm Wrist Palm ...
131569
0
How would i destroy multiple gui's after one is clicked?
8624595
gigabite176
20
2014-12-24 20:56:47
<p>Hi i am very new to scripting and with the help of you guys i've created this local script with a gui</p> <pre class='brush: lua'>-- creating a screen gui local screenGui = Instance.new("ScreenGui") screenGui.Parent = script.Parent --make a text button local textButton = Instance.new ("TextButton") textButton.Parent...
13590
0
How can I make the for loop &quot;for i,v in pairs(char:GetChildren())&quot; do only happen once?
1141038304
Bl_ueHistory
94
2019-06-29 22:57:21
<p><strong><em>Backstory</em></strong> So for loops can be used for many things either that being getting the children of a object or making and event happening a certain amount of times. For me I'm using a for loop to get the children in a object that i will turn its transparency to 1. This script will then will be se...
82676
1
76857
0
46052
chess123mate
5873
2019-06-30 03:24:38
<p>If you want to stop after the first Accessory you find, you can use <code>break</code> to exit the loop early.</p> <p>If you want to apply your effects to all Accessories simultaneously, you must avoid using <code>wait</code> inside the for loop and split up your effects into multiple for loops if needed. In your ca...
1
how do i move a model with this code? (cframe)
391170608
superspeedr1234
60
2020-05-07 01:23:22
<p>i believe script.parent.parent means its the model the location is:game&lt;workspace&lt;pully&lt;meshpart&lt;script heres the script and error message</p> <pre class='brush: lua'>function pull_up_then_down() script.parent.parent:SetPrimaryPartCFrame(CFrame == Vector3.new(-28.688, 9.34, -25.841)) end script.Paren...
102185
1
94416
0
251936426
youtubemasterWOW
2706
2020-05-07 01:35:24
<p>Hello. The problem is that you used <code>Vector3</code> on a CFrame. Also, when setting a CFrame, you mustn't use <code>CFrame = Vector3.new(X, Y Z)</code> as it's just not how it works, and you cannot set a value of a Roblox global. Try this:</p> <pre class='brush: lua'>local function pull_up_then_down() scrip...
0
How to make Change sky on Touch Part and back original sky on stop touch?
1683254402
gta_12344567890
7
2020-07-12 19:29:18
<p>Someone how to make Change skybox on touch part? I need to make my game. And get back sky on stop touching.</p>
108878
1
99946
0
654754467
NeonPandaEyes331
19
2020-07-12 19:40:24
<p>first, you will need a touch script so the script can activate when you touch it</p> <pre class='brush: lua'>script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("HumanoidRootPart") then </pre> <p>you can use this to find if the item touching the part is a real thing</p> <p>then you can creat...
5
My filter is not working, can someone help?
49352468
fireboltofdeath
630
2014-06-13 10:48:08
<p>Here is the script</p> <pre class='brush: lua'>Filtered = {"Word1","Word2","Word3"} game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) for i,v in pairs(Filtered) do if msg == v then p:Kick() end end end) end) </pre> <p>Whenever a player says a word in the Filtered table it should kick them....
6601
1
8731
2
34209956
M39a9am3R
3209
2014-06-13 11:28:27
<p>For this script, you're going to want to use the <a target="_blank" href="http://wiki.roblox.com/index.php?title=Function_dump/String_manipulation#string.find">find method</a>. And I would also advise in using the <a target="_blank" href="http://wiki.roblox.com/index.php?title=Function_dump/String_manipulation#strin...
2
[Hex Terrain]Why is it producing a little gap?
5941236
iDarkGames
483
2017-07-22 17:17:27
<p>I am not sure why is it producing that little gap on this hexagon generator script.</p> <p>Provided picture: <a target="_blank" href="http://">https://gyazo.com/674e2a451561179a638470f7c16b2145</a></p> <p>Provided model: <a target="_blank" href="http://">https://www.roblox.com/my/item.aspx?id=932301764</a></p> <pre ...
45627
1
46452
1
11808841
blowup999
659
2017-07-22 21:24:54
<pre class="brush: lua">row.CFrame = rowPosition * CFrame.new(0, 0, (1 - math.cos(math.pi/3)/2) * rowSize.Z * Row); </pre> <p>Changing that line to that will fix it</p> <p>If you imagine a box around the Hexagon that's it's size. When you move it down by it's size, you're making it so the tip of one end hits the tip of...
0
How to stop a local script from running when you reset?
156249931
jetape
7
2020-03-26 03:46:39
<p>I'm trying to have it so my local script will only run once, so when you click a play button, the script will be destroyed. Of course when I do this and I reset, the code from that script still runs. Is there anyway that I can make the script only run once?</p>
97100
0
How can I disable fighting moves while players are in a certain area?
64427627
osamayousef123
14
2020-04-24 06:38:19
<p>I have a lobby in my game where players wait until they spawn in a map. I typed out this code but it didn't work. The local scripts identified in the code are the scripts that bind a key to a move and I also put a huge part that covers the entire lobby that represents the space in which players won't be able to use ...
100517
0
Does Filtering enabled prevent leaderstats from being changed with an exploit?
41200330
y8pogo123589
0
2018-06-22 19:41:49
<p>I have filtering enabled on my place. When I tested it the money did not go back to its original currency.</p>
60930
0
How can I tell if the player has not typed anything at all in the chat?
80900942
Exploding_Andrew
0
2021-05-04 20:38:13
<p>I am coding for a breaking point type game, and I am trying to get it so if the player hasn't typed anything after the time limit, they get sent to the lobby.</p> <p>The problem is, I do not know how to check if the player hasn't typed anything at all.</p> <p>This is what I have so far.</p> <pre class='brush: lua'>l...
123095
0
Why won't the debounce in the script work?
984990422
Comqts
6
2022-01-07 18:58:55
<p>So basically, I'm trying to make it so when a button is pressed, the smoke turns on, That part works, however, I'm trying to make it so you can disable it with a debounce. If you can, please help.</p> <pre class='brush: lua'>local enabled = false local debounce = false local Model = script.Parent.Parent.Parent.gas s...
128758
2
116594
1
71530978
enes223
312
2022-01-07 20:04:15
<p>You need to set the debounce to true because after the check is completed you only want it to work only once, right? If you want it to only work once then set the debounce to true after the debounce check because other iterations will check the if statement again and the debounce will be true, making it not pass the...
0
how to make it so that if the player joined the game his speed and jump is 100?
697496423
crushersxd
15
2021-04-30 12:52:58
<p>this code isnt working local SpeedGiver = game.Workspace</p> <p>game.Players.PlayerAdded:Connect(function() game.Workspace.Character.Humanoid.WalkSpeed = 100 end)</p> <p>i just dont understant what parent does the character have</p>
122961
0
How to scale models properly through script using Attributes?
1017846707
Overseer_Prince
188
2023-02-21 02:36:24
<p>So anyways</p> <p>I need to scale models using attributes</p> <p>which will be a vector3 value</p> <p>these are the same 2 models with different vector3 values in size for the attribute</p> <p>how would i properly scale them without using anything else like an iv loop to make them the same size of each part</p> <p>F...
133098
1
120191
1
559514967
T3_MasterGamer
2189
2023-02-21 08:09:54
<p><strong>Good news for you, Roblox just announced that they will add a new</strong> <a target="_blank" href="https://create.roblox.com/docs/reference/engine/classes/Model#ScaleTo"><code>Model:ScaleTo()</code></a> <strong>function</strong> 8 days ago <a target="_blank" href="https://devforum.roblox.com/t/release-notes...
0
When I type the command out nothing happens, how can I fix this?
68308759
Patriq_Kane
8
2021-02-23 16:06:04
<pre class='brush: lua'>local plr = game.Players.LocalPlayer local fo = game.ReplicatedStorage.Football game.Players.PlayerAdded:Connect(function(plr) -- Detects player joining and stores player object at the var "plr" plr.Chatted:connect(function(msg) -- Detects when a player chats and stores the message to the va...
120568
3
109927
0
1750439438
mainmodul
30
2021-02-23 16:21:41
<p>Try this:</p> <p>local plr = game.Players.LocalPlayer local fo = game.ReplicatedStorage.Football local prefix = ':' game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:connect(function(msg) msg = msg:lower() if string.sub(msg, 1, 11) == prefix..'give me fo' then fo:Clone() fo:Clone().Parent = plr end end) end...
0
How do you run another script from a differnt script?
573800380
thedemonninja12
0
2020-11-22 00:29:55
<p>I am new to Roblox coding and i need to run a script from a different script but I'm having trouble with it.</p>
116131
1
How would I make a monster spawner but the monsters can only walk in certain areas?
1399623678
EmJay10101
7
2022-07-30 01:59:31
<p>I have made a part that spawns monsters but haven't made the script for it yet. The main bit is making the monsters not being able to travel in different stages in my game, I want them to have a restricted zone for where they can go. Can you help me?</p>
131006
1
118353
0
559514967
T3_MasterGamer
458
2022-07-30 03:02:38
<p>You can use <strong>PathfindingService</strong>. PathfindingService let’s your NPC to go from one destination to another without bumping into walls or falling down holes. You can read the introduction in <a target="_blank" href="https://create.roblox.com/docs/mechanics/pathfinding">the wiki</a>, <a target="_blank" h...
0
How do I make platforms pick a random color and turn off canColide on random?
646913913
jackpanda900
26
2021-02-25 23:00:25
<p>I have tried this,</p> <pre class='brush: lua'>local test = math.random(1,8) local platform = "Platform"..test workspace.Map.platform.canCollide = false </pre> <p>But it wont work. Please help!</p>
120686
4
Is there a way to make a player's game shut down?
13667373
EzraNehemiah_TF2
3552
2015-02-18 15:02:36
<p>I only want it to shut down one person. Not all. I tried <code>:Kick()</code> but they were still able to roam around the server and click on ClickDetectors. How would I make their game crash or shutdown?</p>
15095
0
Why is Textlabel.Text not changing?
149534749
WeaponisedPenguins
97
2021-11-16 21:23:16
<pre class='brush: lua'>local fluffing = game.Workspace.Sounds["Fluffing A Duck"] local textSound = game.Workspace.Sounds["OneShot - Text"] local Dialogue = game.StarterGui.Dialogue.TextLabel fluffing:Play() Dialogue.Text = "Dad: Alrighty son, it's time for bed." wait(4) textSound.Playing = true Dialogue.Text = "Dad: N...
128088
0
How do I fix: Expected 'then' when parsing if statement, got 'print'?
479363584
TheExtremeChocolate
11
2020-12-25 19:02:28
<p>Status.Value = "Get ready to play!"</p> <pre class="brush: lua">wait(2) for i = Gamelength, 0,-1 do for x, player in pairs (plrs) do if player then character = player.Character if not character then --Left the game else if character:Find...
117688
1
107742
0
292429958
Xx_FROSTBITExX
116
2020-12-25 21:19:43
<p>The error is self-explanatory. You forgot a "then" for your if statement. Also, I believe you need 2 more ends after your last end.</p> <pre class='brush: lua'>if character:FindFirstChild("GameTag") then </pre>
0
how can i make a heart based health system?
1865523181
pakancina
19
2022-09-05 17:31:10
<p>i need a health system like in super cube cavern(roblox), or the binding of isaac. both have a health system based on hearts, every time something deals damage to you, you lose half a hearth. i want the player to start with only 3 heaths but i also want it so that lets say touching a part can increase you max health...
131524
0
Script Error attempt to index nil with 'Character',can you fix this?
146100287
Gigaset39
111
2023-03-09 12:31:41
<p>Hello world, im using ChatGPT to modify the folowing script, but it, its a little bit.. yeah..</p> <p>in the rror says: attempt to index nil with 'Character' -line 5</p> <pre class="brush: lua"> local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") loc...
133165
1
120241
1
148527490
manith513
121
2023-03-09 17:56:57
<p>This should be in a local script. I'm assuming that because you used chatGPT that you forgot to do this. Put it into a local script and the error should subside.</p>
2
Does this script still hold up or should I just make my own?
420085911
Glacitron
239
2020-04-02 19:11:51
<p>https://www.roblox.com/library/181259635/qPerfectionWeld-Perfect-welding-for-EVERY-situat</p> <p>The above link is a welding script that I use in my tools, so far its been very good, but it runs into problems whenever say I clone the tool from serverstorage to the players backpack in which I run into some problems (...
97899
1
How to check for a local part on the server?
17349296
ffancyaxax12
181
2020-02-03 22:40:14
<p>I'm making a script that needs to see if a local part exists or not. please help!</p>
94096
2
86904
0
15912341
PhantomVisual
967
2020-02-04 02:54:02
<p>If the "local part" is created by the client, it will simply not exist on the server due to properties of Filtering Enabled.</p> <p>The part will only exist on the client. If you want to check if a part exist on both the client and the server you can use a RemoteEvent to send the part object and check if it's nil or...
0
Won't get all the children in the model [Light Arrow]??
1491184861
666_brithday
103
2023-02-25 01:26:08
<p>My script is suppose to set the transparency to 0 and 1 for all the parts in [light arrow] but it only does 1 random part in the model</p> <pre class='brush: lua'>game.ReplicatedStorage["Light Settings"]["Left Lights"].OnServerEvent:Connect(function() local Switch = script.Parent.Switch local ConLights = scr...
133116
2
120213
1
559514967
T3_MasterGamer
2189
2023-02-26 02:35:04
<p>To change all parts at the same time, use a <a target="_blank" href="https://create.roblox.com/docs/reference/engine/libraries/coroutine"><code>coroutine</code></a>. Wrap Lines 9-11 in either <a target="_blank" href="https://create.roblox.com/docs/reference/engine/libraries/coroutine#wrap"><code>coroutine.wrap()</co...
0
attempt to index nil with 'ID' error fix?
567952906
SavageBeibi
0
2022-05-01 16:50:17
<p>I am doing a simulator and sometimes, when I open a egg, it gives me that error and you can't do anything even if you rejoin. Any ideas? Script:</p> <p>function CreateItem(Object, Position, Equipped, Container) local NewItem = ItemTemplate:Clone()</p> <pre class="brush: lua">NewItem.Name = Object NewItem.i.Value = P...
129878
0
BodyVelocity is putting the player into freefall whenever it runs into an anchored part?
1403274429
Atariwavilus
0
2021-04-06 02:21:44
<p>basically, i'm trying to create rolling</p> <p>i'm using BodyVelocity to make the player go forward, problem is that whenever i roll into something that's anchored, i go flying</p> <pre class='brush: lua'>local BodyVelocity = Instance.new("BodyVelocity") BodyVelocity.MaxForce = Vector3.new(1, 1, 1) * math.huge BodyV...
122054
0
Why won't I respawn in the correct place?
1752724383
Xyternal
218
2021-06-03 16:36:43
<p>I have a intremission and round system and I'm trying to make it so when it is intermission, the player respawns in the spawn point called lobby, but if you are in the game, then you respawn in the spawn point Main. But I keep on spawning in lobby for some reason. I have my script in a loop that keeps on checking if...
124035
2
113068
2
1608691335
scripterhelper5354
854
2021-06-03 18:16:40
<pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(player) local admin = game.ReplicatedStorage.Status while true do if admin.Value == "Intermission" then player.RespawnLocation = game.Workspace.Lobby else player.RespawnLocation = game.Workspace.Main end wait(0.5) ...
0
How do I make it so that the only checkpoint you can get is the next stage's checkpoint in my obby?
37745860
BunjiBloxxer
12
2022-06-22 13:39:07
<p>Currently you can get any checkpoint, whether it's behind you, or 5 stages ahead of you, I want to make it so that only the next stage's checkpoint can be gotten. Here is my checkpoint script in ServerScriptService:</p> <pre class='brush: lua'>local Players = game:GetService('Players') Players.PlayerAdded:Connect(fu...
130463
2
117806
0
94006350
BulletproofVast
776
2022-06-22 21:51:02
<pre class='brush: lua'>for i,v in pairs(script.Parent:GetChildren()) do if v:isA("Part") then v.Touched:Connect(function(hit) local character = hit.Parent local player = game.Players:GetPlayerFromCharacter(character) if player then local t...
0
Positioning a GUI button using scale and mouse position?
1104970547
SuperPuiu
482
2022-09-20 18:06:08
<p>Hello!</p> <p>Currently I'm working on a game that will use only buttons. You will be able to place a button at the mouse position and I want it to be in the same position for every device.</p> <p>I think it is possible, but I didn't find the right idea. Any suggestion on how to do that? Currently, I'm trying to set...
131681
1
118931
0
73170429
imKirda
4353
2022-09-20 18:12:28
<pre class='brush: lua'>UDim2.fromScale(Mouse.X / ScreenGui.AbsoluteSize.X, (Mouse.Y - 36) / ScreenGui.AbsoluteSize.Y) </pre> <p>I think something like this will work since Mouse.X is a number between 0 and screen width, ScreenGui.AbsoluteSize.X is the actualy screen width, so dividing Mouse.X by this number will alway...
0
I need help with this Vector3 Script?
46382260
SpazzMan502
133
2014-11-29 17:47:04
<p>So part of this Toaster I'm making, I want the switch to go down. (The switch's size is 0.2, 0.2, 0.2)</p> <p>I made 2 scripts, one with a specific Vector3 Value to put it at The other one with subtracting then adding Vector3</p> <p>Both of them made the switch go up above the toaster, and not down.</p> <p>Here are ...
12849
1
15891
1
14357591
Perci1
4988
2014-11-29 17:56:59
<p>Subtracting from the <code>y</code> coordinate (or adding negatives) is your best bet.</p> <p>Your problem is likely that the part is either slightly inside of another part or there's some parts in the way.</p> <p>To fix this, use CFrame, for it will ignore other parts in the way.</p> <pre class='brush: lua'>script....
0
[SOLVED] MoveTo is not working for my NPC. What's wrong with this script or am I missing something?
31504923
rabbi99
617
2020-03-27 21:49:52
<p>I'm trying to get my NPC to go to a certain point, but it doesn't seem to work after hundreds of checks. However, this script does work for the Drooling Zombie that's popular in the Toolbox. Can't find anything on the internet about this problem. I also tried this on a basic R15 model. Any help is appreciated!</p> <...
97279
1
89837
0
554038428
Auxatier
59
2020-03-27 21:55:35
<p>I think you have to also include the Pathfinding service and lead it down a route. I recommend you look at this <a target="_blank" href="https://developer.roblox.com/en-us/articles/Pathfinding">Pathfinding Article</a></p> <p>Also, I'm not sure about your script, maybe this will work or not.</p> <p>hum:MoveTo(humRoot...