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

Why do my explosions happen at 0,0,0?

I am trying to make a GUI button that makes users explode when clicked. The explosions do not happen at the position of the player, but at 0,0,0. How do I fix this?

Here is the local script within the GUI button:

local RS = game.ReplicatedStorage
local explosionEvent = RS.Explosion

script.Parent.MouseButton1Click:Connect(function ()
	local plrPosition = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").Position
	explosionEvent:FireServer(plrPosition)
end)

Here is the server script within ServerScriptService:

local RS = game.ReplicatedStorage

local explosionEvent = RS.Explosion
explosionEvent.OnServerEvent:Connect(function(player, plrPosition)
	print(plrPosition)
	local explosion = Instance.new("Explosion", game.Workspace)
	explosion.Position = Vector3.new(plrPosition)
	explosion.BlastRadius = 10
	explosion.DestroyJointRadiusPercent = 0
end)

1 answer

✓ Accepted answer

You dont need the Vector3.new() because plrPosition already has a Vector3 value.

explosion.Position = plrPosition

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