This script is not firing and by that I mean not even trying. I put a breakpoint on the first line and although it should show up right when i join the game, it just refuses to. This is a local script inside of a model inside of a model inside of workspace. Please review it and tell me what is wrong with it. Do local scripts even work inside of workspace? idk
01 | local part = script.Parent.Parent |
02 | local pos = script.Parent.Head.Position |
03 | local player = game.Players.LocalPlayer |
04 | local mouse = player:GetMouse() --Getting the player's mouse |
05 | debounce = false |
06 |
07 | mouse.Move:connect( function () --When the mouse moves |
08 | local target = mouse.Target |
09 | if not target then |
10 | --do nothing |
11 | elseif target.Name = = "Head" then |
12 | print ( "Hi is this firing" ) |
13 | if script.Parent.Parent.Object.Value~ = "nothing" then |
14 | print ( "what about thisss" ) |
15 | debounce = true |
GoldenPhysic's comment is correct, LocalScripts don't work in workspace.
They won't run at all if in workspace.
Local Scripts will only run if it's in a designated area. It can be inside the Player's CharacterModel, PlayerGui, PlayerScripts, BackPack, or in the ReplicatedFirst service(Replicates the contents to the client first).
Link to wiki article: http://wiki.roblox.com/index.php?title=API:Class/LocalScript