"TexureID is not a valid member of MeshPart. Blade2 is not a valid member of model" (but they are)?
So I've got a script that is supposed to change the TextureID and material of a Part that is in the player when a tool is equipped, but it just gives me the errors in the title of the question. If I add a wait(2), it works, but I can't afford to make it wait to change the part. The part is put into the character with a script when the player equips a tool.
Here's the script that inserts the part:
01 | script.Parent.OtherSwordOn.OnServerEvent:Connect( function (Player) |
02 | if Player.Character:FindFirstChild( "Blade2" ) = = nil then |
03 | local RArmWeld = Instance.new( "Weld" ) |
04 | local Box = script.Parent.Parent.Handle:Clone() |
06 | RArmWeld.Part 0 = RArmWeld.Parent |
07 | RArmWeld.Part 1 = Player.Character.LeftHand |
08 | RArmWeld.C 1 = CFrame.new( 0 , - 0.12 , - 2.5 ) *CFrame.Angles( 0 , math.rad( 180 ),math.rad( 90 )) |
10 | Box.CanCollide = false |
11 | Box.Parent = Player.Character |
12 | elseif Player.Character:FindFirstChild( "Blade2" ) ~ = nil then |
13 | Player.Character.Blade 2 :Destroy() |
This script works fine for some reason. ^
These next 2 scripts give the errors. I've tried changing them to :FindFirstChild(), but then the script simply doesn't work
01 | script.Parent.Out.OnServerEvent:Connect( function (Player) |
02 | if Player.NonStats.BusoOn.Value = = true then |
03 | local Stick = script.Parent.Parent |
04 | Stick.Handle.TextureID = "" |
05 | Stick.Handle.BrickColor = BrickColor.new( "Institutional white" ) |
06 | Stick.Handle.Material = "Neon" |
07 | Player.Character.Blade 2. TextureID = "" |
08 | Player.Character.Blade 2. BrickColor = BrickColor.new( "Institutional white" ) |
09 | Player.Character.Blade 2. Material = "Neon" |
10 | Player.Character.UpperTorso.Buso:Play() |
12 | local P 1 = game.ReplicatedStorage [ "Buso For Sout oWo" ] .Steam:Clone() |
13 | P 1. Parent = Stick.Handle |
14 | local P 2 = game.ReplicatedStorage [ "Buso For Sout oWo" ] .Steam:Clone() |
15 | P 2. Parent = Player.Character.Blade 2 |
16 | Stick.Handle.BrickColor = BrickColor.new( "Really black" ) |
17 | Stick.Handle.Material = "SmoothPlastic" |
18 | Stick.Handle.Reflectance = 0.1 |
19 | Player.Character.Blade 2. BrickColor = BrickColor.new( "Really black" ) |
20 | Player.Character.Blade 2. Material = "SmoothPlastic" |
21 | Player.Character.Blade 2. Reflectance = 0.1 |
22 | game:GetService( "Debris" ):AddItem(P 1 , 1 ) |
23 | game:GetService( "Debris" ):AddItem(P 2 , 1 ) |
25 | if Player.NonStats.BusoOn.Value = = false then |
26 | Stick.Handle.TextureID = game.ReplicatedStorage.Swords [ "Dual Katanas" ] .Handle.TextureId |
27 | Stick.Handle.BrickColor = BrickColor.new( "Burnt Sienna" ) |
28 | Stick.Handle.Material = "Slate" |
29 | Stick.Handle.Reflectance = 0 |
30 | Player.Character.Blade 2. TextureID = game.ReplicatedStorage.Swords [ "Dual Katanas" ] .Handle.TextureId |
1 | script.Parent.OutOff.OnServerEvent:Connect( function (Player) |
2 | if Player.NonStats.BusoOn.Value = = false then |
3 | local Stick = script.Parent.Parent |
4 | Stick.Handle.TextureID = game.ReplicatedStorage.Swords [ "Dual Katanas" ] .Handle.TextureId |
5 | Player.Character.Blade 2. TextureID = game.ReplicatedStorage.Swords [ "Dual Katanas" ] .Handle.TextureId |
Thanks for reading! I really need some help with this because it's delaying a feature x.x