Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script not working?

Asked by 9 years ago

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

01local part = script.Parent.Parent
02local pos=script.Parent.Head.Position
03local player = game.Players.LocalPlayer
04local mouse = player:GetMouse() --Getting the player's mouse
05debounce = false
06 
07mouse.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
View all 22 lines...
0
Localscripts don't work in workspace. GoldenPhysics 474 — 9y
0
kk Im currently working on putting that script into an old script I have in the starter pack ill have to make some significant changes though :( Volodymyr2004 293 — 9y

1 answer

Log in to vote
2
Answered by 9 years ago

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

Ad

Answer this question