I Try Script on LocalScript and Put on PlayerStarter > StarterCharacterScripts
And Script this:
FlingPart.Touched:Connect(function(otherPart)
local character = otherPart.Parent
if character:IsA("Model") and character:FindFirstChild("Humanoid") then
local oldPosition = script.Parent.Position
script.Parent.Position = Vector3.new(oldPosition.X, 4.000, oldPosition.Z)
end
end)
and Test but not work at all, what did i do wrong?
I am kind of confused i do not think iâll be able to help .
do you want TweenService?
Note: Roblox recommends using game:GetService("Workspace") because it is the safest option because it ensures that the Workspace service exists. If the service were to be renamed or removed (which is uncommon for Workspace but possible for other services), this method would prevent errors in your script. In contrast, using game.Workspace or workspace could lead to errors if the service is not found.
FlingPart.Touched:Connect(function(otherPart)
local character = otherPart.Parent
if character:IsA("Model") and character:FindFirstChild("Humanoid") then
local oldPosition = script.Parent.HumanoidRootPart.Position
script.Parent.Position = Vector3.new(oldPosition.X, 4.000, oldPosition.Z)
print(oldPosition)
end
end)
If you want to make the part go underground, do this:
FlingPart.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
FlingPart.Position = Vector3.New (0, 10, 0) -- change it to the desired number
end
end)
@Catasangel_2007 to be honest, the function that should happen if the FlingPart is touched has nothing to do with âFlingPartâ. thatâs why im confused.