Can a local script in starterchar scripts fire a server, to a script in the StarterCharacter?

image
image

local script:

local plr = plrs.LocalPlayer
local mouse = plr:GetMouse()
mouse.Button1Down:Connect(function(mouse)
	print("Bot has clicked")
	
	local pos = plr.Character.Humanoid.TargetPoint
	local LookAt = (pos - plr.Character.Head.Position).Unit
	plr.Character:WaitForChild("Shoot"):FireServer(LookAt)
	
	
end)

function in the serverscript:

script.Parent.Shoot.OnServerEvent:Connect(function(player,LookAt)

Note that the StarterCharacter isn’t a player build model. It’s a bot like model.
image

The local script works fine, but the server script won’t start.

All of the scripts within the StarterCharacter you made (the robot) should be in StarterCharacterScripts. For some reason, scripts within StarterCharacter will not be created when creating the character, so any script you want within the character will have to be put in StarterCharacterScripts instead of the StarterCharacter model.

I didn’t know this…it’s working now!! Thankss

No problem! I came across this problem before too and I was also so confused when I figured out the solution lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.