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)
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
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 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)
Workspace.Denis_Prieten.DetectButton:1: Expected '(', '{' or when parsing function call, got '.' - Studio - DetectButton:1 This is the error it gives me
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)
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)
ik this was 4 months ago but make a int value And make the value at 5 in the script put -- And if -Intvalue name-.Value >= 5 then then make the script run after end
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?
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??
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
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) ----------------------------------------------------------------------------------------------------------------
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".
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()
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
It happend to me and i fixed it and here is how. On the top of the screen it Will say view press there and go to output then test and it Will show all ettors.
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
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)
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
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)
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
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)
can someone please tell me why its not working for me (i changed mine to DamageBlock10 And DamageBlock10Event) script: local remote = game.ReplicatedStorage.DamageBlock10Event remote.OnServerEvent:Connect(function(player, MousePosition) local DamageBlock10 = game.ReplicatedStorage.DamageBlock10Event:Clone() DamageBlock10.Parent = workspace DamageBlock10.CFrame = player.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-2) local NewForce = Instance.new("BodyForce") NewForce.Force = Vector3.new(0, workspace.Gravity * DamageBlock10:GetMass(), 0) NewForce.Parent = DamageBlock10 DamageBlock10.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position, MousePosition).LookVector * 50 DamageBlock10.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(10) DamageBlock10:Destroy() end end) end) detectButton: 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) __________________________ Thanks!
try this: detect: local player = game.Players.LocalPlayer local mouse = player:GetMouse() local remote = game.ReplicatedStorage.DamageBlock10Event local debounce = false game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.Q and not gameProcessedEvent and not debounce then debounce = true remote:FireServer(mouse.Hit.p) wait(0.5) debounce = false end end) other: local remote = game.ReplicatedStorage.FireballEvent remote.OnServerEvent:Connect(function(player, MousePosition) if not player or not player.Character or not player.Character:FindFirstChild("Humanoid") then return end 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, game.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 and hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then local humanoid = hit.Parent.Humanoid if humanoid.Health then humanoid.Health = humanoid.Health - 50 fireball:Destroy() end end end) fireball.AncestryChanged:Connect(function() if fireball.Parent == nil then NewForce:Destroy() end end) end)
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.
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)
If anyone body is stuck on the second script, here is a copy and past! the entirety of it is below. It made it shoot like in the video 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 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!
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
your underrated great turtorial!
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
I had to fix so many small mistakes i made but thank you for the help!
small mistakes like that bro?
This is a good tutorial i subscribed
Same
keep goin you help me alot
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
Thanks for the help
when i use it it hits me instead of anything else and dissapears
Great tutorial
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?
How do i make it go only forward and not to my mouse?
i follow the turtorial but some how to part just stand there and not follow my mouse
NICE
How to make the fireball only go the horizontally, like not changing the height
Juse take out the workspace.Gravity and make it 0
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
Its dealing more damage when im closer to player
what if u have more than 1 part
Can you make a version of this that uses a tool instead of a key input?
just do tool.activated
fact : it wont shoot. If you point it to the sky
hey, i got a problem its sayinhg MousePosition isnt real
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
Why does it say UserInputService not a vaild service
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
Thank you😉😉
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
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()
Make a light beam attack like thanos’s power stone
i want to add animation please someone please help me
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
everytime i watch scripting video it always dont work pls help me
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
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
how do i make this so its where am facing
not where my mouse is pointed (pls send scrit in replies)
Workspace.Denis_Prieten.DetectButton:1: Expected '(', '{' or when parsing function call, got '.' - Studio - DetectButton:1 This is the error it gives me
do it have to be r15 because im making a game in r6 and it not working
no
why in the actual world would you make the PROJECTILE server sided
does it still work?
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
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)
@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
can you make any shape?
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
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
it didint work but i keep it
Why I though it was the Super Mario's Fire Flower ability? 🗿
probably it's your profile pal
It worked very well and the dmg is good but can u tell me how can i make it able only in required lvl
ik this was 4 months ago but make a int value And make the value at 5 in the script put -- And if -Intvalue name-.Value >= 5 then
then make the script run after
end
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?
Why Won't It Work?
How do you make it bounce around?
just make it can colide on
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
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??
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
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
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
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 DIDNT WORK FOR ME
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
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
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 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)
everything works except it keeps going up lol. u got a fix?
fireball:destroy() when it registers its hit
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
doesnt work
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)
could this be used as a tool?
yes
Bruh it’s not work
wow it works! but... how would you animate this?
play an animation when player presses Q
@@defnotmylo your suggestion literally helps nobody
Cframe is not a valid member of Part
You have to type CFrame, both C and F should be big
It didn’t work
dont work
"fireball is not a valid member of replicated storage" what am i supposed to do
You grab fireball then bring it to replicated storage
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
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
@@Xyron2ye
i tapped q and a fireball didn't come out
It happend to me and i fixed it and here is how.
On the top of the screen it Will say view press there and go to output then test and it Will show all ettors.
try f
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
Help my fireball isn’t cloning 😭😭😭
Did you fix it? :)
would tween work
Yes it’s harder to do it that way but it makes it a lot smoother
My remote is unknown,why?
make sure to name it correctly eg w/ caps
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
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
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
You are crazy bro hahahahaha
My fireball is not spawning
Tutorial is outdated I suggest looking for a new one.
@@eugene4287 not outdated
its not
@@eugene4287
it doesnt even make part appear when i press Q,bruh...
BRUHH IT WORKS
same happened to me
same bruh
try to switch the keycode
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 didnt work
There’s always one comment that says this
None of this worked
Ye
Did u guys use local scripts?
OOF
@@guy60396they prob didnt
You did it wrong then
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
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
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)
can someone please tell me why its not working for me (i changed mine to DamageBlock10 And DamageBlock10Event)
script:
local remote = game.ReplicatedStorage.DamageBlock10Event
remote.OnServerEvent:Connect(function(player, MousePosition)
local DamageBlock10 = game.ReplicatedStorage.DamageBlock10Event:Clone()
DamageBlock10.Parent = workspace
DamageBlock10.CFrame = player.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-2)
local NewForce = Instance.new("BodyForce")
NewForce.Force = Vector3.new(0, workspace.Gravity * DamageBlock10:GetMass(), 0)
NewForce.Parent = DamageBlock10
DamageBlock10.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position, MousePosition).LookVector * 50
DamageBlock10.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(10)
DamageBlock10:Destroy()
end
end)
end)
detectButton:
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)
__________________________
Thanks!
try this:
detect:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local remote = game.ReplicatedStorage.DamageBlock10Event
local debounce = false
game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.Q and not gameProcessedEvent and not debounce then
debounce = true
remote:FireServer(mouse.Hit.p)
wait(0.5)
debounce = false
end
end)
other:
local remote = game.ReplicatedStorage.FireballEvent
remote.OnServerEvent:Connect(function(player, MousePosition)
if not player or not player.Character or not player.Character:FindFirstChild("Humanoid") then
return
end
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, game.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 and hit.Parent:FindFirstChild("Humanoid") and not hit:IsDescendantOf(player.Character) then
local humanoid = hit.Parent.Humanoid
if humanoid.Health then
humanoid.Health = humanoid.Health - 50
fireball:Destroy()
end
end
end)
fireball.AncestryChanged:Connect(function()
if fireball.Parent == nil then
NewForce:Destroy()
end
end)
end)
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
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)
If anyone body is stuck on the second script, here is a copy and past! the entirety of it is below. It made it shoot like in the video
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)
thx bro
@@mt23xd5 No problem