So what im trying to do is basiclly a fireball move. Not gonna give the whole script,but heres a line.
local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local Char = Player.Character
I tried on local script but it says that 'Char' is a nil value,Why? You probably see what im trying to do.
Basiclly its giving this error about local "Player" And its ruining the whole thing,it works on the studio but not here. Anyone know an answer?
My guess is that you're trying to access the LocalPlayer
from a server-side script. This means that in studio, where everything is local, LocalPlayer will always return Player1. However, in a game, LocalPlayer cannot be accessed unless it's from a LocalScript
which is left somewhere inside the player.
Unfortunately, I can't really help you more unless I see more of the script, but I hope my suggestion will help you fix it.
Possible Problems
Since I don't see your full script, it could be either you are trying to access LocalPlayer in a server-sided script or you are trying to write LocalPlayer instead of reading it. There's a high possibility its the second problem, I'll give explanations to both of the problems below.
First problem answer
You can only access LocalPlayer through a Local Script. Trying to run it through a server-sided script(Regular script) will cause an error.
Second problem answer
If you are trying to get the player's name you should just put:
local Player = game.Players.LocalPlayer.Name
If this was helpful please give accept this answer.