So, I want this script to make the localplayer shoot a beam out of its head when the player presses Q. Script is:
tool = script.Parent head = game.Workspace.Players.LocalPlayer:GetCharacterFromPlayer().WaitForChild("Head") ---------- tool.Equipped:connect(function(mouse) mouse.KeDown:connect(function(key) if key == "q" then f = Instance.new("Part") f.Name = "Effect" f.Shape = "Ball" f.TopSurface = "Smooth" f.BottomSurface = "Smooth" f.Size = Vector3.new(3,3,3) f.CFrame = head.CFrame -- Stuck end end) end) -- Made by dragonmaster4111
No, it wouldn't work. You would have to wait until the character exists and index the character directly, since that isn't a real method (though do not fear, there is a property of player that references the character called Character).
And it should be KeyDown and all you have to do after that is just parent it to workspace or whatever.
Edit: To reference the character from a player, all you have to do is:
--where player is defined as a player local character = player.Character
And to shoot it up, just set the velocity to something like: Vector3.new(0, 100, 0)