#LocalScript in StarterCharacter or StarterPlayer never execute
1 messages · Page 1 of 1 (latest)
must be an outdated version, it would work if there was no problem
local Players = game:GetService("Players") -- Make sure to use :GetService() if you're not already
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
player.CharacterAdded:Connect(function(newChar)
char = newChar
end)
LocalPlayer always exists from the client's perspective, so. Since it's a character script you can just say script.Parent
yeah, might be best if it's a character script, I know it can be funny sometimes if the script is put inside the character
ill try out all of these, thank you
weirdly none of these worked. idk if its roblox itself but ill try more options
script will always have a parent or it can't execute
ill try to parent it to starterplayer
One message removed from a suspended account.
One message removed from a suspended account.
maybe players is not getting set correctly
and its a empty table
so player.localplayer = nil
if players is a table then it wont give a error
One message removed from a suspended account.
update:
in my script i was defining player so i could get the mouse position. i realized that theres a different method of getting the mouse position and expected the code to run normally, but when i tested in roblox player again, nothing would work. only in studio mode. maybe this is just some weird bug
LocalScript in StarterCharacter never executes
LocalScript in StarterCharacter or StarterPlayer never execute