You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Need a model (meteor) to fall in a random spot, in a radius -
What is the issue? Include screenshots / videos if possible!
getting the error:
TweenService:Create property named ‘Position’ cannot be tweened due to type mismatch (property is a ‘Vector3’, but given type is ‘double’) Line 22
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Dev Fourms and Youtube Videos.
Code:
local part = script.Parent
local part2 = script.Parent["Meshes/meteor_Icosphere_cell.004 (1)"]
local start = script.Parent.Parent.Start.Position
local Radius = 30
local destination = math.random(-Radius, Radius)
local floorTime = script.Parent.Parent.Parent.Parent.FloorTime
local debounce = false
task.wait(3)
part.Position = start
part2.Position = start
if debounce == false then
debounce = true
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local tween = game:GetService("TweenService"):Create(part, tweenInfo, {Position = destination})
local tween2 = game:GetService("TweenService"):Create(part2, tweenInfo, {Position = destination})
tween:Play()
tween2:Play()
tween2.Completed:Wait()
script.Parent.Parent.ExplosionSound:Play()
game.ReplicatedStorage.Remotes.Explosion:FireAllClients()
script.Parent.Parent.Explosion.CFrame = script.Parent.Parent.End.CFrame
wait(1)
script.Parent.Parent.Explosion:Destroy()
wait(0.5)
script.Parent:Destroy()
end
Explorer: