Code
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
local Reward = math.random(5,12)
plr.leaderstats.Gems.Value += Reward
script.Parent:Destroy()
end
end
end)
local FloatPos = {
Up = Vector3.new(12.27, 2.013, 15.429);
Down = Vector3.new(12.27, 1.513, 15.429);
}
local TS = game:GetService("TweenService")
local FloatDuration = 0.8
while true do
local Change = {Position = FloatPos.Up}
local Anim = TS:Create(script.Parent, TweenInfo.new(FloatDuration,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut), Change)
Anim:Play()
task.wait((FloatDuration + 0.05))
local Change2 = {Position = FloatPos.Down}
local Anim2 = TS:Create(script.Parent, TweenInfo.new(FloatDuration,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut), Change2)
Anim2:Play()
task.wait((FloatDuration + 0.05))
end
The shine mesh has anchored off but the gem mesh has anchored on