|
| 12 May 2014 06:20 PM |
The clues;
16:19:07.672 - Cannot set Icon of a PlayerMouse 16:19:14.676 - Cannot set Icon of a PlayerMouse 16:19:14.872 - Players.Player1.Backpack.Tool.LocalScript:11: attempt to index global 'Players' (a nil value)
The script;
local mouse = game.Players.LocalPlayer:GetMouse() local debounce = false mouse.Button1Down:connect(function() if debounce == false then debounce = true mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" wait(7) mouse.Icon = "rbxasset://textures\\GunCursor.png" local tool = game:GetService("InsertService"):LoadAsset(56725154) tool.Parent = Players.Player1.Backpack debounce = false end end)
|
|
|
| Report Abuse |
|
|
|
| 12 May 2014 06:20 PM |
| BTW, keep in mind this is a "LocalScript". |
|
|
| Report Abuse |
|
|
| |
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 12 May 2014 06:26 PM |
local mouse = game.Players.LocalPlayer:GetMouse() local debounce = false mouse.Button1Down:connect(function() if debounce == false then debounce = true mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" wait(7) mouse.Icon = "rbxasset://textures\\GunCursor.png" local tool = game:GetService("InsertService"):LoadAsset(56725154) tool.Parent = game.Players.LocalPlayer.BackPack debounce = false end end)
im going upstairs to get somehting downstairs |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 06:28 PM |
@robomax11
Now I get this...
16:27:04.982 - Cannot set Icon of a PlayerMouse 16:27:11.993 - Cannot set Icon of a PlayerMouse 16:27:12.179 - BackPack is not a valid member of Player |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 12 May 2014 06:39 PM |
| You can't change the icon with :GetMouse() |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 06:45 PM |
@TheProgrammingMaster Then how do you ? |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 06:47 PM |
tool.Equipped:connect(function(mouse) end) |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 06:54 PM |
| But where do I put it inside the script? |
|
|
| Report Abuse |
|
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 12 May 2014 07:08 PM |
BackPack isn't a valid member of player, Backpack is. |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 07:14 PM |
| It's an event that triggers the function. |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 12 May 2014 07:23 PM |
oops
im going upstairs to get somehting downstairs |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 07:24 PM |
Okay, the errors are fixed but I cant get the icon to change...
17:23:24.997 - Cannot set Icon of a PlayerMouse 17:23:32.008 - Cannot set Icon of a PlayerMouse 17:23:32.281 - Cannot set Icon of a PlayerMouse
New LocalScript;
tool = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse() local debounce = false mouse.Button1Down:connect(function() if debounce == false then debounce = true mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" wait(7) mouse.Icon = "rbxasset://textures\\GunCursor.png" local tool = game:GetService("InsertService"):LoadAsset(56725154) tool.Parent = game.Players.LocalPlayer.Backpack debounce = false end tool.Equipped:connect(function(mouse) end) end)
Also, I think the "GetService" function isn't working either. Correct me if I am wrong. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 May 2014 07:44 PM |
Face-palm
The event is when you equipped the tool. |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 07:51 PM |
@TheProgrammingMaster
Says the experienced scripting user.
And I'm basically a noob at this so you should expect plentiful of questions... |
|
|
| Report Abuse |
|
|
| |
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 12 May 2014 09:52 PM |
You've already been told how to fix it. You cannot change the player's mouse icon using the GetMouse method, as someone has pointed out to you twice. The only way, to change a player's mouse icon, is if you use a tool (using the Equipped event) or a hopperbin (using the Selected event).
Tool.Equipped:connect(function(Mouse) Mouse.Icon = "BlahBlahBlah" end) |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 10:59 PM |
New Error (But Finally I manage to get Icons to change);
20:59:16.835 - Players.Player1.Backpack.Tool.LocalScript:16: ')' expected (to close '(' at line 9) near 'end'
New LocalScript;
tool = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse() local debounce = false tool.Equipped:connect(function(Mouse) Mouse.Icon = "rbxasset://textures\\GunCursor.png" if debounce == false then debounce = true mouse.Button1Down:connect(function() Mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" wait(7) Mouse.Icon = "rbxasset://textures\\GunCursor.png" local tool = game:GetService("InsertService"):LoadAsset(56725154) tool.Parent = game.Players.LocalPlayer.Backpack end end end)
|
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
| |
|
|
| 12 May 2014 11:32 PM |
@DataStore
unexpected symbol near ')'
Couldn't you just fix the script by whole? It's the whole point I posted it here. |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 11:34 PM |
dude,you DONT ADD 3 ENDS,HE WAS SHOWING WHERE TO CHANGE
gawd...
tool = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse() local debounce = false tool.Equipped:connect(function(Mouse) Mouse.Icon = "rbxasset://textures\\GunCursor.png" if debounce == false then debounce = true mouse.Button1Down:connect(function() Mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" wait(7) Mouse.Icon = "rbxasset://textures\\GunCursor.png" local tool = game:GetService("InsertService"):LoadAsset(56725154) tool.Parent = game.Players.LocalPlayer.Backpack end) end end)
|
|
|
| Report Abuse |
|
|