If the player doesn't take damage, use this version instead: local remote = game.ReplicatedStorage.FireballEvent remote.OnServerEvent:Connect(function(player,MousePosition) local fireball = game.ReplicatedStorage.Fireball:Clone() fireball.Parent = workspace fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then hit.Parent.Humanoid.Health -= 50 -- You can choose how much damage they take fireball:Destroy() end end) end)
@@BradenLmao You might've anchored it for some reason? That or you messed up the code and so it spawns where the object is in the Replicated Storage thingy, instead of the HumanoidRootPart.
guys i make a destroy event when the fireball touch the wall but i dont understand why the fireball disappeared early before it hit the wall, and sometimes it even disappeared later after it hit the wall😢
and what if I want to make it an ability that can be used from a chosen person? Thats only a question I want to make a server where me and my friends got different powers
i know it is 5 month ago but. make a tool calld whatever u want make a script that fire a script when u use that tool and click on the right button. if u want to make like lvl system and have a lvl required just make an intvalu make the number in the valu to what ur lvl is make a leaderstats scrip that a coonected to the int value and then combine the intvalue in the tool script that tells u required lvl
It doesn't work. I don't Know what I did wrong. Please help. First Script (DetectButton) ----------------------------------------------------------------------------------------------------------- local player=game.Players.LocalPlayer local mouse=player.GetMouse() local remote=game.ReplicatedStorage.FireballEvent local debounce=false game:GetService("UserInputService").InputBegan:Connect(function(input,gpe) if input.KeyCode==Enum.KeyCode.R and not gpe and not debounce then debounce=true remote:FireServer(mouse.Hit.p) wait(0.5) debounce=false end end) ----------------------------------------------------------------------------------------------------------- Second Script (ServerScriptService Script) ----------------------------------------------------------------------------------------------------------- local remote=game.ReplicatedStorage.FireballEvent remote.OnServerEvent:Connect(function(player,MousePosition) local fireball=game.ReplicatedStorage.Fireball:Clone() fireball.Parent=workspace fireball.CFrame=player.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-2)
local NewForce=Instance.new("BodyForce") NewForce.Force=Vector3.new(0,workspace.Gravity*fireball:GetMass(),0) NewForce.Parent=fireball
fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character)then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50) fireball:Destroy() end end) end) ----------------------------------------------------------------------------------------------------------------
What did the error message say? Or was there not one and it's just not working? Is the first script on a local script under StarterCharacterScripts and did you put the Fireball and FireballEvent in ReplicatedStorage? Is the second script a regular script under ServerScriptService?
@@rooblixkewb7952 bro it’s been so long since I commented that I forgot about this game. I think I just used another tutorial but thanks for answering anyways. 👋
I wanted to ask if i did anything wrong in the first script local player = game.Players.LocalPlayer local mouse = player:GetMouse() local remote = game.ReplicatedStorage.FireballEvent local debounce = false game.GetService("UserInputService").InputBegan:Connect(function(input,gpe) if input.KeyCode == Enum.Kecode.Q and not gpe and not debounce then debounce = true remote:FireServer(mouse.Hit.p) wait(.5) debounce = false end end)
I rewatched a couple of time the video but couldn't find why the fireball wasn't accually moving can someone help? Heres my script local remote = game.ReplicatedStorage.FireballEvent remote.OnServerEvent:Connect(function(player,MousePosition) local fireball = game.ReplicatedStorage.Fireball:Clone() fireball.Parent = workspace fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2) fireball.Massless = true
local newForce = Instance.new("BodyForce") newForce.Force = Vector3.new(0,workspace.Gravity*fireball:GetMass(),0) newForce.Parent = fireball
fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")and not hit:IsDescendantOf(player.Character) then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50) fireball:Destroy() end end) end)
Your mistake is in the line fireball.Velocity = Vector3.new(player.Character.HumanoidRootPart,MousePosition).LookVector * 50 Rather than it being a Vector3.new, it should be CFrame.new The corrected line should state: fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart, MousePosition).LookVector * 50 I apologise that this is a few months late, but there's the issue you had! Hope it helps! - Necra
you probably have can collide on and the flying infinetly can be fixed with this at the end of your code btw replace purple with whatever your part is called, you can also change the 10 to whatever u want the dissapear time to be. wait(10) if Purple.Parent then Purple:Destroy()
@@yostdev Hey isee that you Comment is quiteRect so i have a Question In theDetectButton Scipt it tells me that 'UserinputService' is not a valid Service Name so what did you do the fix that??
When you use ":FireServer()" 3:48, it sends the player who fired it as a parameter to the server (he's also sending the mouse position) and then here 5:02, he's accessing it with "player" and "MousePosition".
fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50) fireball:Destroy() end end) end) DetectButton: local player = game.Players.LocalPlayer local mouse = player:GetMouse() local remote = game.ReplicatedStorage.FireballEvent local debouce = false game:GetService("UserInputService").InputBegan:Connect(function(input, gpe) if input.KeyCode == Enum.KeyCode.Q and not gpe and not debouce then debouce = true remote:FireServer(mouse.Hit.p) wait(.5) debouce = false end end)
how about a npc shooting fireballs at you but if they dont aim perfectly, creates a shockwave at the position where the fireball hit something (the shockwave grows then it fades)
why is this not working local player = game:GetService("Players") local mouse = player:GetMouse() local remote = game.ReplicatedStorage.RemoteEvent local debounce = false game:GetService("UserInputService").InputBegan:Connect(function(input,gpe) if input.KeyCode == Enum.KeyCode.E and gpe and not debounce then debounce = true remote:FireServer(mouse.Hit.p) wait(5) debounce = false end end) local remote = game.ReplicatedStorage.RemoteEvent remote.OnServerEvent:Connect(function(player,MousePosition) local fireball = game.ReplicatedStorage.Slash:Clone() fireball.Parent = workspace fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2) fireball.Massless = true
local newForce = Instance.new("BodyForce") newForce.Force = Vector3.new(0,workspace.Gravity*fireball:GetMass(),0) newForce.Parent = fireball
fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50) fireball:Destroy()
So i did copy the code, it work, but i want that when i click on a text button i have permission to use the dettect button script, and if i dont click on the text button it do nothing
i got it too, if u got the player service using local player = game:game:GetService("Players"), thats wrong, you need to use local player = game.Players.LocalPlayer and GetMouse needs a () at the final: GetMouse()
yeah no this did not work honestly i spent 2 hours on this and figure out the it didn't work and its not for mobile also the quality of the video is very confusing are you able to make a mobile and pc one?
my codes: detect: local player = game.Players.LocalPlayer local mouse = player:GetMouse() local remote = game.ReplicatedStorage.FireballEvent debounce = false game:GetService("UserInputService").InputBegan:Connect(function(input, gpe) if input.KeyCode == Enum.KeyCode.F and not gpe and not debounce then debounce = true remote:FireServer(mouse.Hit.p) wait(.5) debounce = false end end) release: local remote = game.ReplicatedStorage.FireballEvent remote.OnServerEvent:Connect(function(player,MousePosition) local fireball = game.ReplicatedStorage.Fireball:Clone() fireball.Parent = game.workspace fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2) local NewForce = Instance.new("BodyForce") NewForce.Force = Vector3.new(0,workspace.Gravity * fireball:GetMass(),0) NewForce.Parent = fireball fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position,MousePosition).LookVector * 50 fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then hit.Parent.Humanoid.Health -= 50 fireball:Destroy() end end) end)
can someone tell me what i did something wrong? (sorry if my english is bad :( ) first script(I replaced the fireball for a bone lol) local player = game.Players.LocalPlayer local mouse = player.GetMouse() local remote = game.ReplicatedStorage.BoneEvent local debounce = false game:GetService(UserInputService).InputBegan:Connect(function(Input,gpe) if Input.KeyCode == Enum.KeyCodeQ and not gpe and not debounce then debounce = true remote:FireServer(mouse.Hit.p) wait(.5) debounce = false end end) and the second script local remote = game.ReplicatedStorage.BoneEvent remote.OnServerEvent:Connect(function(player, mouseposition) local bone = game.ReplicatedStorage.bone:clone() bone.Parent = workspace bone.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame(0,0,-2) local NewForce = Instance.new("BodyForce") NewForce.force = Vector3.new(0, workspace.Gravity * bone:GetMass(),0) NewForce.Parent = bone bone.Velocity = CFrame.new(player.Character.HumanoidRootPart.position, mouseposition).LookVector * 50 bone.touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.character) then hit.Parent:FindFirstChild("humanoid"):TakeDamage(15) bone:Destory() end end) end)
Workspace.Denis_Prieten.DetectButton:1: Expected '(', '{' or when parsing function call, got '.' - Studio - DetectButton:1 This is the error it gives me
Can anybody help? for some reason it wont work Here are my scripts: Detect: local player = game.Players.LocalPlayer local mouse = player:GetMouse() local remote = game.ReplicatedStorage.FireballEvent debounce = false game:GetService("UserInputService").InputBegan:Connect(function(input, gpe) if input.KeyCode == Enum.KeyCode.F and not gpe and not debounce then debounce = true remote:FireServer(mouse.Hit.p) wait(.5) debounce = false end end) release: local remote = game.ReplicatedStorage.FireballEvent remote.OnServerEvent:Connect(function(player,MousePosition) local fireball = game.ReplicatedStorage.Fireball:Clone() fireball.Parent = game.workspace fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2) local NewForce = Instance.new("BodyForce") NewForce.Force = Vector3.new(0,workspace.Gravity * fireball:GetMass(),0) NewForce.Parent = fireball fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position,MousePosition).LookVector * 50 fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then hit.Parent.Humanoid.Health -= 50 fireball:Destroy() end end) end) and i have set up the names correctly so they match and placed them in the files shown in the video i cant find whats wrong
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local remote = game.ReplicatedStorage.DamageBlock10Event local debouce = false game:GetService("UserInputService").InputBegan:Connect(function(input, gpe) if input.KeyCode == Enum.KeyCode.Q and not gpe and not debouce then debouce = true remote:FireServer(mouse.Hit.p) wait(.5) debouce = false end end)
u can add a mobile button then make it so when u touch a button it activates the ability so you have to touch the screen in order to hit after you tap the button
FireballEvent is not a valid member of ReplicatedStorage "ReplicatedStorage" LocalPlayer is not a valid member of DataModel "Baseplate" these problems which appeared when i tried to play and now im just tooooo tired and being sad bc i cant understand why i cant get rect of it..............pls help
My fireball wont appear, These are my scripts: The Script: local remote = game.ReplicatedStorage.FireBallEvent remote.OnServerEvent:Connect(function(player, MousePosition) local fireball = game.ReplicatedStorage.Clone() fireball.Parent = workspace fireball.CFrame = player.HumaniodRootPart.Part.CFrame ^ CFrame.new(0,0-2)
fireball.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")and not hit:IsDescendantOf(player.Character) then hit.Parent:FindFirstChild("Humaniod"):TakeDamage(50) fireball:Destroy() end end) end) The Local Script: local player = game.Players.LocalPlayer local mouse = player.GetMouse() local remote = game.ReplicatedStorage.FireBallEvent local debounce = false game.GetService("UserInputService").InputBegan.Connect(function(Input,gpe) if Input.KeyCode == Enum.KeyCode.Z and not gpe and not debounce then debounce = true remote:FireServer(mouse.Hit.p) wait(.5) debounce = false end end) Also when i check output nothing happens with I think its the Detect Script.
You've probably already fixed this but in your server script right here: fireball.CFrame = player.HumaniodRootPart.Part.CFrame ^ CFrame.new(0,0-2) You use a ^ instead of *, when working with CFrames, you need to times the value, not put it to an exponent.
it works really well and even though i had a few problems they were just typos or mistakes and not because of the video
you explain very well, thanks for the tutorial!
This really worked for me but i made some bugs during so i had to fix it but you earned a sub and like!
If the player doesn't take damage, use this version instead:
local remote = game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player,MousePosition)
local fireball = game.ReplicatedStorage.Fireball:Clone()
fireball.Parent = workspace
fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
local NewForce = Instance.new("BodyForce")
NewForce.Force = Vector3.new(0,workspace.Gravity * fireball:GetMass(),0)
NewForce.Parent = fireball
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position,MousePosition).LookVector * 50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then
hit.Parent.Humanoid.Health -= 50 -- You can choose how much damage they take
fireball:Destroy()
end
end)
end)
tysm it fixed
@@goldenollies8338 Yw. I'm glad it helped. :D
Can you help bc whenever i press button it spawns but not infront of me and it just spawns where it was on the map b4 i put it in replicated storage
@@BradenLmao You might've anchored it for some reason?
That or you messed up the code and so it spawns where the object is in the Replicated Storage thingy, instead of the HumanoidRootPart.
Thanks for the Tutorial, had just a little problem because of a typo. I didnt knew writting Cframe instand of CFrame made such a big diffrence xD
guys i make a destroy event when the fireball touch the wall but i dont understand why the fireball disappeared early before it hit the wall, and sometimes it even disappeared later after it hit the wall😢
and what if I want to make it an ability that can be used from a chosen person? Thats only a question I want to make a server where me and my friends got different powers
if you know how can you tell me?
@@urucff9138 I second this, I want to know aswell
i know it is 5 month ago but. make a tool calld whatever u want make a script that fire a script when u use that tool and click on the right button. if u want to make like lvl system and have a lvl required just make an intvalu make the number in the valu to what ur lvl is make a leaderstats scrip that a coonected to the int value and then combine the intvalue in the tool script that tells u required lvl
I would suggest add the fire effect to it or a particle emitter and use one of the chungus effects on it
then do it lol
your underrated great turtorial!
Thanks! I fixed some errors that i made so it will work, I'll use it for my battlegrounds game!
It doesn't work. I don't Know what I did wrong. Please help.
First Script (DetectButton)
-----------------------------------------------------------------------------------------------------------
local player=game.Players.LocalPlayer
local mouse=player.GetMouse()
local remote=game.ReplicatedStorage.FireballEvent
local debounce=false
game:GetService("UserInputService").InputBegan:Connect(function(input,gpe)
if input.KeyCode==Enum.KeyCode.R and not gpe and not debounce then
debounce=true
remote:FireServer(mouse.Hit.p)
wait(0.5)
debounce=false
end
end)
-----------------------------------------------------------------------------------------------------------
Second Script (ServerScriptService Script)
-----------------------------------------------------------------------------------------------------------
local remote=game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player,MousePosition)
local fireball=game.ReplicatedStorage.Fireball:Clone()
fireball.Parent=workspace
fireball.CFrame=player.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-2)
local NewForce=Instance.new("BodyForce")
NewForce.Force=Vector3.new(0,workspace.Gravity*fireball:GetMass(),0)
NewForce.Parent=fireball
fireball.Velocity=CFrame.new(player.Character.HumanoidRootPart.Position,MousePosition).LookVector*50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character)then
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50)
fireball:Destroy()
end
end)
end)
----------------------------------------------------------------------------------------------------------------
It looks completely right to me, maybe the
fireball.Parent=workspace
could turn into
fireball.Parent=game.Workspace
What did the error message say? Or was there not one and it's just not working? Is the first script on a local script under StarterCharacterScripts and did you put the Fireball and FireballEvent in ReplicatedStorage? Is the second script a regular script under ServerScriptService?
@@rooblixkewb7952 bro it’s been so long since I commented that I forgot about this game. I think I just used another tutorial but thanks for answering anyways. 👋
Can you make a version of this that uses a tool instead of a key input?
just do tool.activated
I wanted to ask if i did anything wrong in the first script
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.FireballEvent
local debounce = false
game.GetService("UserInputService").InputBegan:Connect(function(input,gpe)
if input.KeyCode == Enum.Kecode.Q and not gpe and not debounce then
debounce = true
remote:FireServer(mouse.Hit.p)
wait(.5)
debounce = false
end
end)
at the bottom u put
wait(.5)
said Keycode instead of KeyCode, and said "." instead of ":" on multiple occasions
@@michaelpeou1475 the wait is correct
im new at this and idk that script at all but i thing its because u put "Kecode" instead of KeyCode
@Sfloon you have to put : not . Is what it's saying
Everything worked the fireball spawned, only thing is, its not moving. How do I fix this? also how do I add an animation
I suggest you to learn some basic scripting firsf
Its anchored
Ive did this before and it worked but now when im doing it the firball just spawns where i had it before i put it in replicated storage
What if it acts as if you threw 2 or 5 but really, the player only threw it one time?
I rewatched a couple of time the video but couldn't find why the fireball wasn't accually moving can someone help? Heres my script
local remote = game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player,MousePosition)
local fireball = game.ReplicatedStorage.Fireball:Clone()
fireball.Parent = workspace
fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
fireball.Massless = true
local newForce = Instance.new("BodyForce")
newForce.Force = Vector3.new(0,workspace.Gravity*fireball:GetMass(),0)
newForce.Parent = fireball
fireball.Velocity = Vector3.new(player.Character.HumanoidRootPart,MousePosition).LookVector * 50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")and not hit:IsDescendantOf(player.Character) then
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50)
fireball:Destroy()
end
end)
end)
Your mistake is in the line
fireball.Velocity = Vector3.new(player.Character.HumanoidRootPart,MousePosition).LookVector * 50
Rather than it being a Vector3.new, it should be CFrame.new
The corrected line should state:
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart, MousePosition).LookVector * 50
I apologise that this is a few months late, but there's the issue you had!
Hope it helps!
- Necra
When I shoot the fireball it bounces off objects and flies infinitely, it helps
you probably have can collide on and the flying infinetly can be fixed with this at the end of your code btw replace purple with whatever your part is called, you can also change the 10 to whatever u want the dissapear time to be. wait(10)
if Purple.Parent then
Purple:Destroy()
@@AtlasTheRelic Thank you so much!
@@yostdev Hey isee that you Comment is quiteRect so i have a Question
In theDetectButton Scipt it tells me that 'UserinputService' is not a valid Service Name so what did you do the fix that??
the script is correct and everything but it doesnt disappear when the fireball hit a dummy
how do u did it? i cant bc it gives me a error on "GetMouse" and idk how to fix it
remember to add a :destroy() function
How to make the fireball only go the horizontally, like not changing the height
Juse take out the workspace.Gravity and make it 0
This is a good tutorial i subscribed
Same
This is really nice, but it doesnt seem to work for me, maybe next time you should put a copy of the code in the comments
Didn't seem to work for me either.
Which means we've likely both messed something up.
How the heck did you acsessed the character in a script? I mean, you can use the character block in a LocalScript, but in a Script? How???
When you use ":FireServer()" 3:48, it sends the player who fired it as a parameter to the server (he's also sending the mouse position)
and then here 5:02, he's accessing it with "player" and "MousePosition".
@@Saiki13 ohhhhhhhhhhhhhhhhhh thx man
Instead of key code use user input type because that’s the new version for it
script:
local remote = game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player, MousePosition)
local fireball = game.ReplicatedStorage.Fireball:Clone()
fireball.Parent = workspace
fireball.CFrame = player.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-2)
local NewForce = Instance.new("BodyForce")
NewForce.Force = Vector3.new(0, workspace.Gravity * fireball:GetMass(), 0)
NewForce.Parent = fireball
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position, MousePosition).LookVector * 50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50)
fireball:Destroy()
end
end)
end)
DetectButton:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.FireballEvent
local debouce = false
game:GetService("UserInputService").InputBegan:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.Q and not gpe and not debouce then
debouce = true
remote:FireServer(mouse.Hit.p)
wait(.5)
debouce = false
end
end)
thank you bro
i was also gon send something like this but guess not lol (also thanks)
what if u have more than 1 part
fact : it wont shoot. If you point it to the sky
I had to fix so many small mistakes i made but thank you for the help!
small mistakes like that bro?
do it have to be r15 because im making a game in r6 and it not working
no
very cool, one thing is to put the script on the secription i think it would help
i typed mine in the desc if you need it
@@stoneshelly7337 what?
i follow the turtorial but some how to part just stand there and not follow my mouse
how about a npc shooting fireballs at you but if they dont aim perfectly, creates a shockwave at the position where the fireball hit something (the shockwave grows then it fades)
good idea
Bruh it’s not work
why in the actual world would you make the PROJECTILE server sided
It worked very well and the dmg is good but can u tell me how can i make it able only in required lvl
why is this not working
local player = game:GetService("Players")
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.RemoteEvent
local debounce = false
game:GetService("UserInputService").InputBegan:Connect(function(input,gpe)
if input.KeyCode == Enum.KeyCode.E and gpe and not debounce then
debounce = true
remote:FireServer(mouse.Hit.p)
wait(5)
debounce = false
end
end)
local remote = game.ReplicatedStorage.RemoteEvent
remote.OnServerEvent:Connect(function(player,MousePosition)
local fireball = game.ReplicatedStorage.Slash:Clone()
fireball.Parent = workspace
fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
fireball.Massless = true
local newForce = Instance.new("BodyForce")
newForce.Force = Vector3.new(0,workspace.Gravity*fireball:GetMass(),0)
newForce.Parent = fireball
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position.MousePosition).LookVector*50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50)
fireball:Destroy()
end
end)
end)
So i did copy the code, it work, but i want that when i click on a text button i have permission to use the dettect button script, and if i dont click on the text button it do nothing
yo bro i think this can work:
if gpe == true then return nothing
what it basicliy does it checks if the player is doing other thing or he is playing
remember to put it inside the key part
@@user-px1yy2tt6m ok
In the output appears a error message for "GetMouse" in the DetectionButton script, anyone knows how to fix that?
i got it too, if u got the player service using local player = game:game:GetService("Players"), thats wrong, you need to use
local player = game.Players.LocalPlayer
and GetMouse needs a () at the final: GetMouse()
How do you make it bounce around?
just make it can colide on
yeah no this did not work honestly i spent 2 hours on this and figure out the it didn't work and its not for mobile also the quality of the video is very confusing are you able to make a mobile and pc one?
it says "invalid argument #2 to 'new' (vector3 expected, got CFrame)" can u help me with at?
I'm getting this, did you manage to solve it?
I did everything but i made mistakes i tried fixing them but the ball spawns on one place help
my codes:
detect:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.FireballEvent
debounce = false
game:GetService("UserInputService").InputBegan:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.F and not gpe and not debounce then
debounce = true
remote:FireServer(mouse.Hit.p)
wait(.5)
debounce = false
end
end)
release:
local remote = game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player,MousePosition)
local fireball = game.ReplicatedStorage.Fireball:Clone()
fireball.Parent = game.workspace
fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
local NewForce = Instance.new("BodyForce")
NewForce.Force = Vector3.new(0,workspace.Gravity * fireball:GetMass(),0)
NewForce.Parent = fireball
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position,MousePosition).LookVector * 50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then
hit.Parent.Humanoid.Health -= 50
fireball:Destroy()
end
end)
end)
when i use it it hits me instead of anything else and dissapears
can someone tell me what i did something wrong? (sorry if my english is bad :( )
first script(I replaced the fireball for a bone lol)
local player = game.Players.LocalPlayer
local mouse = player.GetMouse()
local remote = game.ReplicatedStorage.BoneEvent
local debounce = false
game:GetService(UserInputService).InputBegan:Connect(function(Input,gpe)
if Input.KeyCode == Enum.KeyCodeQ and not gpe and not debounce then
debounce = true
remote:FireServer(mouse.Hit.p)
wait(.5)
debounce = false
end
end)
and the second script
local remote = game.ReplicatedStorage.BoneEvent
remote.OnServerEvent:Connect(function(player, mouseposition)
local bone = game.ReplicatedStorage.bone:clone()
bone.Parent = workspace
bone.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame(0,0,-2)
local NewForce = Instance.new("BodyForce")
NewForce.force = Vector3.new(0, workspace.Gravity * bone:GetMass(),0)
NewForce.Parent = bone
bone.Velocity = CFrame.new(player.Character.HumanoidRootPart.position, mouseposition).LookVector * 50
bone.touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.character) then
hit.Parent:FindFirstChild("humanoid"):TakeDamage(15)
bone:Destory()
end
end)
end)
thank you Very Much
thx
you forgot the quotations on (UserInputService) it should be ("UserInputService") on the first script
you also did on the first script. local mouse = .GetMouse() when it should be local mouse = :GetMouse()
and on this line if Input.KeyCode == Enum.KeyCodeQ and not gpe and not debounce then there needs to be A . here Enum.KeyCode.Q
how do i make it so that it casts an animation and then fires the fireball?
u just make the animatin and tell it to play the animation when button clicked
@@T-ogla how do i do that
@@foxenbox you're gonna need a whole other tutorial for that
Why I though it was the Super Mario's Fire Flower ability? 🗿
probably it's your profile pal
Workspace.Denis_Prieten.DetectButton:1: Expected '(', '{' or when parsing function call, got '.' - Studio - DetectButton:1 This is the error it gives me
Works perfectly, but how do I put a lifetime on it so it doesn't continue forever
Debris im p sure
Debris:AddItem(fireball,LifeTime)
so the script worked perfectly fine, but i have some friends that are on mobile and want to play the game, how do i add mobile controls?
U can call the function via a gui button
Thanks for the help
How do you stop the little bit of lag that the projectile does as it spawns, it makes it wonky to fire it while moving
Look into event:FireAllClients(), client replication
hey, i got a problem its sayinhg MousePosition isnt real
i made all scripts right and then played pressed Q and nothing happened this is a scam liar
try to switch the keycode, cause if you press q, it will navigate through the buttons. i use f
"fireball is not a valid member of replicated storage" what am i supposed to do
You grab fireball then bring it to replicated storage
keep goin you help me alot
everytime i watch scripting video it always dont work pls help me
I did everything and it's still not working
Like when I press Q it doesnt show the fireball
Check the output
@@7emeraldsZ wdym
It’s basically a thing that shows you an error if you have one
The output is at the view section and I think it’s at the top section
Why does it say UserInputService not a vaild service
Great tutorial
Its dealing more damage when im closer to player
How do i make it go only forward and not to my mouse?
everything works except it keeps going up lol. u got a fix?
fireball:destroy() when it registers its hit
how do i make this so its where am facing
not where my mouse is pointed (pls send scrit in replies)
it didnt work for me i followed all the steps when i went to test i i pressed q and nothing happended
look at the output look for errors
try another keycode, i tried q and didnt work, then i switch to f and work
@wundev how do I make it so that my part faces the direction of my mouse instead of go to it?
you would have to use complex maths
mouse.hit
sensi it did not work and idk what i did wrong can u sent a link to the script so i can copy and paste
it diddnt work for me either
Is it possible to make it mobile compatible?
Can someone tell me how i can make it in tool and a left-click instead of a Key
Add a tool set HandleRequired off the make script like tool.activited:Connect(function) then the event fire server
could this be used as a tool?
yes
Hi im rtx heal im gonna make a game so you knows good scripting i was going to ask that if you can help me on it
wow it works! but... how would you animate this?
play an animation when player presses Q
@@defnotmylo your suggestion literally helps nobody
it not working for me idk why only the player move the part doesn't move :(
See if you switched up the periods colons and commas because thats what I did wrong
Help my fireball isn’t cloning 😭😭😭
Did you fix it? :)
Make a light beam attack like thanos’s power stone
can you make any shape?
Can anybody help? for some reason it wont work
Here are my scripts:
Detect:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.FireballEvent
debounce = false
game:GetService("UserInputService").InputBegan:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.F and not gpe and not debounce then
debounce = true
remote:FireServer(mouse.Hit.p)
wait(.5)
debounce = false
end
end)
release:
local remote = game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player,MousePosition)
local fireball = game.ReplicatedStorage.Fireball:Clone()
fireball.Parent = game.workspace
fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
local NewForce = Instance.new("BodyForce")
NewForce.Force = Vector3.new(0,workspace.Gravity * fireball:GetMass(),0)
NewForce.Parent = fireball
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position,MousePosition).LookVector * 50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then
hit.Parent.Humanoid.Health -= 50
fireball:Destroy()
end
end)
end)
and i have set up the names correctly so they match and placed them in the files shown in the video i cant find whats wrong
nvm i fixed it
Can you put the scripts in the comments for people to copy and paste cause i did it wrong and idk what I did
nice thats a good idea
@@xyronswflye
Cframe is not a valid member of Part
You have to type CFrame, both C and F should be big
Thank you😉😉
None of this worked
Ye
Did u guys use local scripts?
OOF
@@TrustedTheOnethey prob didnt
You did it wrong then
i want to add animation please someone please help me
does it still work?
NICE
Pls reply the script so I can copy it and paste thx I can’t remember all this scripting so pls reply the script
😊😊😊😊😊❤❤❤❤❤
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.DamageBlock10Event
local debouce = false
game:GetService("UserInputService").InputBegan:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.Q and not gpe and not debouce then
debouce = true
remote:FireServer(mouse.Hit.p)
wait(.5)
debouce = false
end
end)
local remote = game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player,MousePosition)
local fireball = game.ReplicatedStorage.Fireball:Clone()
fireball.Parent = game.workspace
fireball.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
local NewForce = Instance.new("BodyForce")
NewForce.Force = Vector3.new(0,workspace.Gravity * fireball:GetMass(),0)
NewForce.Parent = fireball
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position,MousePosition).LookVector * 50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then
hit.Parent.Humanoid.Health -= 50
fireball:Destroy()
end
end)
end)
it didint work but i keep it
IT DIDNT WORK FOR ME
Why Won't It Work?
My remote is unknown,why?
make sure to name it correctly eg w/ caps
My fireball is not spawning
Tutorial is outdated I suggest looking for a new one.
@@eugene4287 not outdated
its not
@@eugene4287
is it possible for mobile support for this
u can add a mobile button then make it so when u touch a button it activates the ability so you have to touch the screen in order to hit after you tap the button
@@crituus thanks
FireballEvent is not a valid member of ReplicatedStorage "ReplicatedStorage"
LocalPlayer is not a valid member of DataModel "Baseplate"
these problems which appeared when i tried to play and now im just tooooo tired and being sad bc i cant understand why i cant get rect of it..............pls help
Go learn the basics 🗿
You need to add a remote event in replicated storage, Name it "FireballEvent". + I suggest learning basic lua 1st.
@@ZenkaiDragon400 fr
how do you not know what that means
Bruh it’s not work
It didn’t work
would tween work
Yes it’s harder to do it that way but it makes it a lot smoother
doesnt work
doesnt work but my own fault
You are crazy bro hahahahaha
Nothing is the video worked
this video is from 2023, roblox studio has updated, now this code don't work
honestly pin me
wasted my time didnt work unsubbed
you bad
My fireball wont appear, These are my scripts: The Script:
local remote = game.ReplicatedStorage.FireBallEvent
remote.OnServerEvent:Connect(function(player, MousePosition)
local fireball = game.ReplicatedStorage.Clone()
fireball.Parent = workspace
fireball.CFrame = player.HumaniodRootPart.Part.CFrame ^ CFrame.new(0,0-2)
local NewForce = Instance.new("BodyForce")
NewForce.Force = Vector3.new(0,workspace.Gravity ^ fireball:GetMass(),0)
NewForce.Parent = fireball
fireball.Velocity = CFrame.new(player.Character.HumanoidRootPart).Position,MousePosition.LookVector ^ 50
fireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")and not hit:IsDescendantOf(player.Character) then
hit.Parent:FindFirstChild("Humaniod"):TakeDamage(50)
fireball:Destroy()
end
end)
end)
The Local Script:
local player = game.Players.LocalPlayer
local mouse = player.GetMouse()
local remote = game.ReplicatedStorage.FireBallEvent
local debounce = false
game.GetService("UserInputService").InputBegan.Connect(function(Input,gpe)
if Input.KeyCode == Enum.KeyCode.Z and not gpe and not debounce then
debounce = true
remote:FireServer(mouse.Hit.p)
wait(.5)
debounce = false
end
end)
Also when i check output nothing happens with I think its the Detect Script.
You've probably already fixed this but in your server script right here: fireball.CFrame = player.HumaniodRootPart.Part.CFrame ^ CFrame.new(0,0-2)
You use a ^ instead of *, when working with CFrames, you need to times the value, not put it to an exponent.
@@OrchidDev aight bet thxx