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: Attempt to index global 'char' a nil value

Previous Thread :: Next Thread 
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
19 Jul 2014 12:30 PM
This occurs on line 10 of this code:

sGui = game:GetService("StarterGui")
plr = script.Parent.Parent
char = script.Parent.Parent.Character
mouse = plr:GetMouse()
mouse.Icon = "http://www.roblox.com/asset/?id=167199721"

sGui:SetCoreGuiEnabled("All", false)
sGui:SetCoreGuiEnabled("Chat", true)

for i ,v in next, char:GetChildren() do
if v:IsA("Part") then v.Anchored = true; v.Transparency = 1
if v:IsA("Shirt") then v:Destroy()
if v:IsA("Pants") then v:Destroy()
if v:IsA("CharacterMesh") then v:Destroy()
end
end
end
end
end

Oh and the Mouse's Icon doesn't change but it doesn't throw any error.

The life of a man, can be taken so quickly.
Report Abuse
UgOsMiLy is not online. UgOsMiLy
Joined: 15 Sep 2009
Total Posts: 2095
19 Jul 2014 12:36 PM
for i ,v in next, char:GetChildren() do

should be

for i ,v in next(char:GetChildren()) do
Report Abuse
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
19 Jul 2014 12:37 PM
oooo i see

why do i even bother trying different things i should stick to for i, v in pairs()do

The life of a man, can be taken so quickly.
Report Abuse
UgOsMiLy is not online. UgOsMiLy
Joined: 15 Sep 2009
Total Posts: 2095
19 Jul 2014 12:39 PM
Lel.. That's what I do.
Report Abuse
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
19 Jul 2014 12:41 PM
i try.... i fail

The life of a man, can be taken so quickly.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
19 Jul 2014 12:44 PM
You can't set the Icon of the mouse using :GetMouse()
http://wiki.roblox.com/index.php?title=GetMouse_(Method)/Player

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
19 Jul 2014 12:58 PM
so how?

The life of a man, can be taken so quickly.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
19 Jul 2014 01:02 PM
You have to use a Tool or Hopperbin to change the Icon.
http://wiki.roblox.com/index.php?title=Mouse

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
19 Jul 2014 01:03 PM
Yea I just read it :P

So I have to get the player to equip the tool?

The life of a man, can be taken so quickly.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
19 Jul 2014 01:04 PM
Yep. There used to be a way to force-equip a tool but I don't remember how :P

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
19 Jul 2014 01:09 PM
*just finishes coding it*

*Studio Crashes*

thank you roblox for autosaves <3

The life of a man, can be taken so quickly.
Report Abuse
ZirutoHellfire is not online. ZirutoHellfire
Joined: 16 Aug 2012
Total Posts: 4647
19 Jul 2014 01:14 PM
Do I have to keep setting the mouse icon when the player dies or no?

The life of a man, can be taken so quickly.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
19 Jul 2014 01:26 PM
UserInputService.MouseIconEnabled = false

RunService.RenderStepped:connect(function()
PlayerGui.ScreenGui.MouseIcon.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
end)
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