|
| 08 Nov 2016 09:13 AM |
Here is the key parts of the script causing me the problem.
local SWStuffs = plr:WaitForChild("Arm2").Blade
SWStuffs.Parent.StaC1 = 1 SWStuffs.Parent.StaC2 = 1 SWStuffs.Parent.StaC3 = 1
These work. The script works. HOWEVER... the problem begins when I try to use the script. For some reason, despite StaC1, StaC2, and StaC3 all being right next to SWStuffs, the script seems to throw this error no matter what I do:
"StaC1 is not a valid member of Model".
To me, this is bs. Because everything else on the script works inside of or around SWStuffs. It takes a very similar path to another set of the exact same parts under another name in the set up and those work perfectly. I tried re-arranging the StaCs to be INSIDE the SWStuffs, but that didn't work. I've tried renaming things in the script and the bricks countless times. I even saved, and re-opened Studio to see if that fixed anything.
Here is the full script. I'm sure some of you know what to do because I sure as all h^ll don't.
local isKeyDown = {} mouse = game.Players.LocalPlayer:GetMouse() local n1 = 1 local sequence = NumberSequence.new(n1) local n0 = 0 local sequence2 = NumberSequence.new(n0) local plr = game.Workspace:FindFirstChild(script.Parent.Parent.Parent.Parent.Name) local SWStuffs = plr:WaitForChild("Arm2").Blade
mouse.KeyDown:connect(function(key) if key == "e" then if SWStuffs.Aura.Transparency == sequence then SWStuffs.Aura.Transparency = sequence2 SWStuffs.Core.Transparency = sequence2 SWStuffs.Effect1.Transparency = sequence2 SWStuffs.Effect2.Transparency = sequence2 SWStuffs.SaberLight.Enabled = true SWStuffs.Parent.Parent.Cheste.StationarySaberColor1.Transparency = 1 SWStuffs.Parent.Parent.Cheste.StationarySaberColor2.Transparency = 1 SWStuffs.Parent.Parent.Cheste.StationarySaberColor3.Transparency = 1 SWStuffs.Ignite:Play() SWStuffs.Hum:Play() SWStuffs.Parent.StaC1 = 0 SWStuffs.Parent.StaC2 = 0 SWStuffs.Parent.StaC3 = 0 elseif SWStuffs.Aura.Transparency == sequence2 then SWStuffs.Aura.Transparency = sequence SWStuffs.Core.Transparency = sequence SWStuffs.Effect1.Transparency = sequence SWStuffs.Effect2.Transparency = sequence SWStuffs.SaberLight.Enabled = false SWStuffs.Parent.Parent.Cheste.StationarySaberColor1.Transparency = 0 SWStuffs.Parent.Parent.Cheste.StationarySaberColor2.Transparency = 0 SWStuffs.Parent.Parent.Cheste.StationarySaberColor3.Transparency = 0 SWStuffs.Shutdown:Play() SWStuffs.Hum:Stop() SWStuffs.Parent.StaC1 = 1 SWStuffs.Parent.StaC2 = 1 SWStuffs.Parent.StaC3 = 1 end end end)
Yes. The script is newby. Play nice in the comments. I've been away from scripting for a while and I need some touching up. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 09:25 AM |
That error means when you are defining "StaC1", it's pointing to the wrong model which can produce an error such as that. Instead of doing a ".parent", try pointing to the exact location of the part. If it still renders as an error, then this is probably a bug. (This is probably the wrong way going about this, but considering you seem desperate.. It wouldn't hurt).
-------------------------------- \/ SWStuffs.Parent.StaC1 = 1
-------------------------------- SWStuffs.Parent.StaC2 = 1 SWStuffs.Parent.StaC3 = 1
|
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 09:31 AM |
Well I would think that's what the problem is... were it not for the similar path otherwise that goes completely around it, and the fact that this script was working perfectly for a few minutes. Then all of a sudden these 3 bricks seem to stop working with the script.
SWStuffs.Parent.Parent.StationarySaberColor1 SWStuffs.Parent.Parent.StationarySaberColor2 SWStuffs.Parent.Parent.StationarySaberColor3
^- These all work perfectly. So... I don't know what to do. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 09:33 AM |
Just try what I posted above. Tell me how it goes. Then, we can think from there.
|
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 08 Nov 2016 09:34 AM |
firstly no, it is not a "bug".
secondly you have a ton of .Parent's
third i dont understand what you're trying to do with these: SWStuffs.Parent.StaC1 = 0 SWStuffs.Parent.StaC1 = 1
you're setting an object to a number...?
|
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 08 Nov 2016 09:35 AM |
| well yes this is a bug but not a bug on roblox's side. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 09:35 AM |
Nice contradictory statement. 11/10.
|
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 08 Nov 2016 09:42 AM |
| lol I rate it a perfect 5/7 |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 10:00 AM |
Guy,
You want your Computer to throws errors, or u would never find out why the program doesn't work. Most programmers put a print statement at least every-other line. This will find your problem:
print(SWStuffs) print(SWStuffs.Parent) SWStuffs.Parent.StaC1 = 1 SWStuffs.Parent.StaC2 = 1 SWStuffs.Parent.StaC3 = 1
|
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
|
| 08 Nov 2016 10:30 AM |
| you just told him to print objects |
|
|
| Report Abuse |
|
|
|
| 12 Nov 2016 07:16 AM |
| xD Oh my god how did I not see this. I was tired as hell. Thank you. |
|
|
| Report Abuse |
|
|