#weird error
131 messages · Page 1 of 1 (latest)
Print plr.characyer.primarypart.positiob
i will
And hit ?
i changed the name to hitpos but dw i changed it in this line
Print it
uh
okay
nil
it changes from where i am looking
when i look in the air it's nil
when i look in the ground it's land
when i look at a char it's HRP
what should i do @quiet zenith
** You are now Level 2! **
if hitPos and hitPos.Position then
Local ray = ray.new...(...... hit.position)...
End
file
local fireball = game.ReplicatedStorage.Fireball:Clone()
local event = game.ReplicatedStorage.FireClientEvent
local charging = false
local fireballsize = 10
script.Parent.OnServerEvent:Connect(function(plr,val,Hitpos)
if val == "Hold" then
charging = true
fireball.Parent = game.Workspace.Visuals
fireball.Position = plr.Character.PrimaryPart.Position + Vector3.new(0,50,0)
event:FireAllClients("Holding",fireball)
wait(0.4)
while charging == true do
if fireballsize < 80 then
fireballsize = fireballsize + 1
fireball.sizeValue.Value = fireballsize
end
wait(0.05)
end
print(fireballsize)
elseif val == "Shoot" then
charging = false
print(Hitpos)
local hitting = true
local ray = Ray.new(plr.Character.PrimaryPart.Position, CFrame.new(plr.Character.PrimaryPart.Position, Hitpos).LookVector * 500)
local HitPart = game.Workspace:FindPartOnRayWithIgnoreList(ray, {game.Workspace.Visuals, plr.Character})
fireball.sizeValue.Value = -1
fireball.Size = Vector3.new(fireballsize,fireballsize,fireballsize)
game.Debris:AddItem(fireball,10)
event:FireAllClients("Shooting",fireball,HitPart)
fireball.Touched:Connect(function(hit)
if hit.Parent:WaitForChild("Humanoid") and hitting == true and hit.Parent.Name ~= plr.Name then
hit.Parent.Humanoid:TakeDamage(20)
event:FireAllClients("Hit",fireball)
elseif not hit.Parent:WaitForChild("Humanoid") and hitting == true then
event:FireAllClients("HitPart",fireball)
end
end)
end
end)
thanks
imma try
eh
what?
didn't work
local char = plr.Character or plr.CharacterAdded:Wait()
this won't change in anything
That not the char the proboem
What is ray
the same line that i am having a problem with but in a local script and instead of hitpos it's mouse.hit.p
and it doesn't give ANY errors
Yes because raycast is just finding the first element that is on a ray
so?
U just need to see if there is a part found
After hitPos
if hitPos then
--Firetoserver
End
The same ?
yup
Change hitpos to hitPos.position
what should i do
wew
it is telling you exactly
what to do
vector3 expected
oh yeah
it wants you to pass a vector 3
.
so whatever you thought you sent is not sending
or is in the incorrect order
dark you may go on
so basically i should change cframe.new to vector3.new?
have not really read the convi
not sure what you're even sending
dark could keep helping you from here
Here replace hitpos by hitpos.Position and that should works
if it's too simple
then tell me the solution
it didn't work
Hitpos is nil?
it's nil when i look towards nothing
Local hitPos =...
if hitPos then
--Firetoserver
End
same error
** You are now Level 3! **
¯\_(ツ)_/¯
print the 3 arguments of the event
script.Parent.OnServerEvent:Connect(function(plr,val,Hitpos)
print(plr, val, hitpos)
if val == "Hold" then
and then
The problem is hitpos
can you do what I asked first?
print them
and then tell me what you get
Add
and hitPos.Position after if hitpos
the error line
local ray = Ray.new(plr.Character.PrimaryPart.Position, CFrame.new(plr.Character.PrimaryPart.Position, Hitpos).LookVector * 500)
CFrame.new(plr.Character.PrimaryPart.Position, Hitpos)
right there you have it
Position, Hitpos)
you're passing an instance
like dark said after giving many loops
add Hitpos.Position
Land doesn't have position
I think terrain
.
if it worked i am gay
okay then you just have to to sanity check
and debounce when it's land
Local hitPos =...
if hitPos and hitpos.position then
--Firetoserver
End
lol
it's still wrong
cause you're passing an instance to a vector op
idk
but I cannot add land to 10
can I?
seems like that's not something they teach at school 
that said, fix that line, and have an if statement to check if it's land
if it's land return
that's it
you got it from here