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 » Scripting Helpers
Home Search
 

Re: My script wont work

Previous Thread :: Next Thread 
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 12:13 PM
It works in offline mode but not in online i got a online out put window and the error is this:attempt to call 'char' a userdata value
and the script wont work its in a hopper bin. heres the script:
Bin = script.Parent
Backpack = Bin.Parent
Me = Backpack.Parent
char = Me.Character
PlayerGui = Me.PlayerGui
Humanoid = char.Humanoid
Torso = char.Torso
Head = char.Head
LeftArm = char("Left Arm")
RightArm = char("Right Arm")
LeftLeg = char("Left Leg")
RightLeg = char("Right Leg")
Neck = Torso("Neck")
RightShoulder = Torso("Right Shoulder")
LeftShoulder = Torso("Left Shoulder")
RightHip = Torso("Right Hip")
LeftHip = Torso("Left Hip")

NeckC0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
NeckC1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
LeftShoulderC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
LeftShoulderC1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
RightShoulderC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
RightShoulderC1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
LeftHipC0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
LeftHipC1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
RightHipC0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
RightHipC1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)

function RefreshWelds()
Neck.C0 = NeckC0
Neck.C1 = NeckC1
RightShoulder.C0 = RightShoulderC0
RightShoulder.C1 = RightShoulderC1
LeftShoulder.C0 = LeftShoulderC0
LeftShoulder.C1 = LeftShoulderC1
RightHip.C0 = RightHipC0
RightHip.C1 = RightHipC1
LeftHip.C0 = LeftHipC0
LeftHip.C1 = LeftHipC1
end

Activated = false

function Attack(mouse)
if not Activated then

Activated = true

mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"

Gyro = Instance.new("BodyGyro")
Gyro.Parent = Torso
Gyro.D = 50
Gyro.maxTorque = Vector3.new(0, 0, 0)
Gyro.cframe = Torso.CFrame
Velocity = Instance.new("BodyVelocity")
Velocity.Parent = Torso
Velocity.maxForce = Vector3.new(0, 0, 0)
Position = Instance.new("BodyPosition")
Position.Parent = Torso
Position.maxForce = Vector3.new(0, 0, 0)

Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
Velocity.velocity = Torso.CFrame.lookVector * 120
Humanoid.PlatformStand = true

Position.maxForce = Vector3.new(0, math.huge, 0)
Position.position = Torso.Position+Vector3.new(0, 23, 0)

Position.maxForce = Vector3.new(0, 0, 0)
handle2 = Instance.new("Part")
handle2.Parent = char
handle2.TopSurface = "Smooth"
handle2.BottomSurface = "Smooth"
handle2.Size = Vector3.new(5, 6, 5)
handle2.Name = Me.Name
handle2.CFrame = Torso.CFrame
if char:findFirstChild("PVB") ~= nil then
handle2.BrickColor = BrickColor.new("Alder")
end
Owner = Instance.new("ObjectValue")
Owner.Parent = handle2
Owner.Name = "Owner"
Owner.Value = Me
weld = Instance.new("Weld")
weld.Part0 = Torso
weld.Part1 = handle2
weld.Parent = Torso
weld.C0 = CFrame.new(0, 0, 0)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
handle21 = Instance.new("Part")
handle21.Transparency = 0.7
handle21.Parent = char
handle21.BrickColor = BrickColor.new("Bright red")
if char:findFirstChild("PVB") ~= nil then
handle21.BrickColor = BrickColor.new("Royal purple")
end
handle21.TopSurface = "Smooth"
handle21.BottomSurface = "Smooth"
handle21.Size = Vector3.new(5, 1, 5)
handle21.CFrame = Torso.CFrame
weld2 = Instance.new("Weld")
weld2.Part0 = Torso
weld2.Part1 = handle21
weld2.Parent = Torso
weld2.C0 = CFrame.new(0, 0, 0)*CFrame.fromEulerAnglesXYZ(0, 0, 0)
p2 = Instance.new("SpecialMesh")
p2.Parent = handle21
p2.Scale = Vector3.new(2, 26, 2)
p2.MeshType = "Sphere"
p = Instance.new("SpecialMesh")
p.Parent = handle2
p.Scale = Vector3.new(15, 20, 15)
p.MeshType = "FileMesh"
p.MeshId = "http://www.roblox.com/asset/?id=1051557"
Gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
Gyro.cframe = Torso.CFrame * CFrame.Angles(1.57, 0, 0)
Bleh = ""
for i = 1 , 50 do
Gyro.cframe = Gyro.cframe * CFrame.fromEulerAnglesXYZ(0, 0.8, 0)

for u, c in pairs(workspace:GetChildren()) do
if c.Name ~= Me.Name then
h = c:findFirstChild("Humanoid")
t = c:findFirstChild("Torso")
if h ~= nil and t ~= nil then
if (Torso.Position-t.Position).magnitude <= 17 then
h.Sit = true
t.Velocity = t.CFrame.lookVector * 150 + Vector3.new(0, 75, 0)
if Bleh ~= t then
h:TakeDamage(script.Parent.Parent.Parent.supercool.Lvl.Value*4)
Bleh = t
end
t.CFrame = t.CFrame * CFrame.Angles(math.random(-3, 3), math.random(-3, 3), math.random(-3, 3))
end
end
end
end
wait()
end
Humanoid.PlatformStand = false
Position:Remove()
Velocity:Remove()
Gyro:Remove()
handle2:Remove()
handle21:Remove()
RefreshWelds()
wait(2)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
Activated = false
end
end

function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() Attack(mouse) end)
end

script.Parent.Selected:connect(onSelected)
Report Abuse
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 12:15 PM
Ik its long but plz help ;-;
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Apr 2014 12:19 PM
Bin = script.Parent
Backpack = Bin.Parent
Me = game.Players.LocalPlayer -- IF IN A LOCALSCRIPT
char = Me.Character
PlayerGui = Me.PlayerGui
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
02 Apr 2014 12:21 PM
Put this entire script in a LocalScript and try again.

@vlek if this wasnt in a LocalScript it wouldnt work at all. HopperBins no longer support Server-Sided scripts.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Apr 2014 12:24 PM
Yeah, :/

How did they use that as an hack?
Report Abuse
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 01:04 PM
wait should i out ina local script then put that ina hopper bin?
Its a mouseClicked function I dont think that would work with a local script with out a tool base.
Report Abuse
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 01:04 PM
put*
Report Abuse
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 02:45 PM
any help?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
02 Apr 2014 02:57 PM
Hopperbin>
-LocalScript
--Code
Report Abuse
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 05:47 PM
Thanks you helped alot!
Report Abuse
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 06:42 PM
and now i cant select the hopper bin...
Report Abuse
hempants15 is not online. hempants15
Joined: 22 Jul 2011
Total Posts: 153
02 Apr 2014 06:43 PM
nvm i can select it if i spam the numbers.. but it dont works..
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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