This is my first post.
I am trying to make a game like JailBreak/ Mad City not a lot copying but I need help doing the script it didnt work.
I am trying to make a robbable bank !
I tried it 3 times but it still didnt work.
So if you could help me with the script it would mean a lot to me.
I am just a begginer so I need help.
Thank You !
Ah, this is mistake all beginners make, if you are a beginner. You need to practice first in Lua, and build your knowledge up. AlvinBlox made a video about this on his channel. You need to start off simple and build up.
Scripting requires capital letters in certain places. You might need to go and rewatch it to make sure everything is written correctly. Otherwise you will get errors and the script will not work.
Iâm talking about the biggest mistake people make while trying to script, you need to start off easy and gain more knowledge along the way. Making something like this with very little knowledge of programming will just frustrate you.
No problem, you will gain knowledge along the way. Might take a few years but you will be able to do it, just starting out a complex thing like this will just frustrate you.
Alright so I have a lava script in my game, here is the script.
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
h.Health = h.Health-100
end
end
script.Parent.Touched:connect(onTouched)
This script contains an error. This error is
12:37:22.754 - Workspace.Lava.Script:2: attempt to index nil with 'findFirstChild'
This means that on line 2, there is an error with âfindFirstChildâ
If I remember correctly, this is happening because I did not capitalize the first F in 'findFirstChild"
No, that was not the case. But the errors with scripts will tell you which line and which place the script is in, and then the piece that is causing the error.
Okay I do not have the robbable bank yet but I will try and get it because I remember I took a picture of it so I will try and find it if I dont then I will do the script all over again and I will show it here !