Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

i am trying to make a charge fireball it works in stiudo but not in game how do i fix?

the fireing script its saying local M nil

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local we = false

mouse.KeyDown:Connect(function(key) -- lol i tryed keyheld ;-;
    key = key:lower()
    if key == "q" then
game.ReplicatedStorage.events.Fire:FireServer()
		
	end
end)

mouse.KeyUp:Connect(function(key) -- lol i tryed keyheld ;-;
    key = key:lower()
    if key == "q" then
game.ReplicatedStorage.events.metor:FireServer()
	
end
end)

the script that responses

local down = true		
local we = true




game.ReplicatedStorage.events.Fire.OnServerEvent:Connect(function(player,size)
	local x = Instance.new("Part",player.Character.Head)
	local i = Instance.new("BodyVelocity",x)
       we = true
		local mp = player:GetMouse()
		x.Shape = "Ball"
		x.BrickColor = BrickColor.new("Deep orange")
		x.Material = "Neon" 
		x.Transparency = .5
		x.BottomSurface = "Smooth"
		x.TopSurface = "Smooth"
		i.Velocity = Vector3.new(0,0,0)
		x.CanCollide = false      
		x.Position = player.Character.Head.Position
		
		
			
			
		i.Name = "go"
	i.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	
		
		x.Name = "flame"
	while we == true do
		wait(.45)
		x.Size = x.Size + Vector3.new(.15,.15,.15)
		
	end
	


end)

game.ReplicatedStorage.events.metor.OnServerEvent:Connect(function(player)

	local m = player:GetMouse()
	local x = player.Character.Head.flame
	local g = player.Character.Head.flame.go
	we = false
	g.Velocity = m.Hit.LookVector *90
x.Parent = workspace
	x.Anchored = false	
	end)

5 comments

0

keydown is deprecated, use UserInputService instead

0

i tryed that did not work

0

It does work. You used it wrong. Your script will break should KeyDown be removed.

0

How do you expect to get the "size" if you aren't sending it as an argument ?

0

On the first event ^ and on second, you can't get player's mouse from server.

1 answer

You need to put that in a Local Script if you want to make it work on Local Roblox

2 comments

0

its a remote vent i want all the players to see it

0

ohhh

This discussion is preserved as it was. New answers, comments, and votes are closed.