Scale is not a valid member of Part I dont know why...
pcall(game.Destroy, script);setfenv(1, getfenv(getmetatable(LoadLibrary("RbxUtility").Create).__call));pcall(game.Destroy, script) local plr = game.Players.LocalPlayer repeat wait() until plr.Character plr = game.Players.LocalPlayer char = plr.Character torso = char.Torso head = char.Head neck = torso.Neck sound = Instance.new("Sound", head) sound.SoundId = "rbxassetid://" sound.Volume = 100 sound:Play() sound.Looped = true plr.Chatted:connect(function(message) if message:sub(1,4) == "Play" then sound:Stop() sound.SoundId = "http://www.roblox.com/asset/?id="..message:sub(6) sound:Play() end end) wait(0.1) Orb = Instance.new("Part", workspace) Orb.Shape = Enum.PartType.Ball Orb.Anchored = false Orb.BrickColor = BrickColor.new("Bright red") Orb.CanCollide = false Orb.Scale = Vector3.new(.13,0.1,0.05) Orb.Parent = head Orb.TopSurface = 0 Orb.BottomSurface = 0 Orb.Material = "SmoothPlastic" ogsize = Orb.Scale weld = Instance.new("Weld", head) weld.Part0 = mouth weld.Part1 = head weld.C1 = CFrame.new(0,-.25,-.6) game:service'RunService'.RenderStepped:connect(function() Orb.Scale = Orb.Scale:lerp(Vector3.new(ogsize.X+sound.PlaybackLoudness/20000,sound.PlaybackLoudness/1000,ogsize.Z),0.8) end)
I dotn know why this is or how i help to avoid it
Scale is not a valid member of Part, of course. It's Size.
So replace
Orb.Scale = Vector3.new(.13,0.1,0.05)
with
Orb.Size = Vector3.new(.13,0.1,0.05)
Same thing here :
Orb.Size = Orb.Size:lerp(Vector3.new(ogsize.X+sound.PlaybackLoudness/20000,sound.PlaybackLoudness/1000,ogsize.Z),0.8) 39 end)
Good day!
~Pengdoo
Part
s have Size
; Mesh
es have Scale
. See the API for Part.
Minor notes:
local
variables when possible (slightly faster in performance and good to avoid name collisions when you have more code); ex, on line 4 just add local
to the beginning of the line (same for other lines where you make new variables). If you need to access the variable outside the scope of where you're defining, don't make it global. Orb.Parent = head
after all assignments to Orb
(so after what is currently line 31). It's a very minor thing in this case, but it's a good habit to get into.pcall(game.Destroy, script)
twice on your first line. This is equivalent to game.Destroy(script)
, which is probably equivalent to script.Parent = nil
and/or script:Destroy()
.setfenv
on the first line. If you don't absolutely need it, you should avoid messing with the function environment.game:GetService
, not game:service
(which is deprecated).