generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Annoying, Seemingly unsolveable problem...

Previous Thread :: Next Thread 
TheCarefulGuy is not online. TheCarefulGuy
Joined: 04 Aug 2012
Total Posts: 136
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
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
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
TheCarefulGuy is not online. TheCarefulGuy
Joined: 04 Aug 2012
Total Posts: 136
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
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
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 is not online. 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 is not online. 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
sanjay2003 is not online. sanjay2003
Joined: 03 Nov 2012
Total Posts: 740
08 Nov 2016 09:35 AM
Nice contradictory statement. 11/10.


Report Abuse
HlCOM is not online. HlCOM
Joined: 29 Mar 2009
Total Posts: 3332
08 Nov 2016 09:42 AM
lol I rate it a perfect 5/7
Report Abuse
BJCarpenter is online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
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 is not online. HlCOM
Joined: 29 Mar 2009
Total Posts: 3332
08 Nov 2016 10:30 AM
you just told him to print objects
Report Abuse
TheCarefulGuy is not online. TheCarefulGuy
Joined: 04 Aug 2012
Total Posts: 136
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image