Hello! I am currently working on an interactive test and everything works great! However, I realized I never tested it in actual game mode. And for some reason I get this in the server output:
Players.Player1.PlayerGui.MidnaGui.Frame.ImageButton.LocalScript:2: attempt to index field 'Character' (a nil value) 15:04:41.272 - Stack Begin 15:04:41.272 - Script 'Players.Player1.PlayerGui.MidnaGui.Frame.ImageButton.LocalScript', Line 2 15:04:41.273 - Stack End
I have the script in the Player's PlayerGui>MidnaGui>Frame>ImageButton>LocalScript
Mid = game.ServerStorage:FindFirstChild("Midna Anim")
prt = game.Players.LocalPlayer.Character:WaitForChild("Par2")--This is where it supposedly can't find Character within Local Player
num = game.ServerStorage.NumValue
gui = script.Parent.Parent.Parent
txt = gui.Frame2.TextBox
plr = game.Players.LocalPlayer
txt.Text = "What is it, " ..plr.Name .."?"
script.Parent.MouseButton1Click:connect(function()
if num.Value == 1 then
prt.Parent.Head.Apear:Play()
Mid.Parent = game.Workspace
Mid:MoveTo(prt.Position)
gui.Frame2.Visible = true
num.Value = 2
elseif num.Value == 2 then
if prt.Parent.Head.Apear.isPlaying == true then
prt.Parent.Head.Apear:Stop()
end
prt.Parent.Head.Vanish:Play()
Mid.Parent = game.ServerStorage
gui.Frame2.Visible = false
num.Value = 1
end
end)
I'm not sure why it can't find the character in game but can in studio. Any help?
Thanks! ~Minikitkat

2 comments
Are you using a server or local script?
A LocalScript