Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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)
0
keydown is deprecated, use UserInputService instead User#20388 0 — 5y
0
i tryed that did not work helleric -3 — 5y
0
It does work. You used it wrong. Your script will break should KeyDown be removed. User#19524 175 — 5y
0
How do you expect to get the "size" if you aren't sending it as an argument ? Axdrei 107 — 5y
0
On the first event ^ and on second, you can't get player's mouse from server. Axdrei 107 — 5y

1 answer

Log in to vote
-1
Answered by 5 years ago

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

0
its a remote vent i want all the players to see it helleric -3 — 5y
0
ohhh mistergamer100 0 — 5y
Ad

Answer this question