Hello, I need help with getting this script to change the RocketPropulsion's TargetOffset and a BillboardGui's StudsOffsetWorldSpace. For some reason, the script works, but skips of the Offset parts. Here is the ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LevelEvent = ReplicatedStorage:WaitForChild("LevelEvent")
local passId = 965287019
function isAuthenticated(Player) -- checks to see if the player owns your pass
return game:GetService("GamePassService"):PlayerHasPass(Player, passId)
end
game.Players.PlayerAdded:Connect(function(Player)
if isAuthenticated(Player) then
Random = math.random(25,50)
else
Random = math.random(5,20)
end
end)
local function onLevelFired(player)
math.randomseed(tick())
local Stats = player.Stats
local Offset = game.workspace[player.Name.."Dog"].RocketPropulsion.TargetOffset
Stats.MaxHealth.Value = Stats.MaxHealth.Value + Random
Stats.MaxHunger.Value = Stats.MaxHunger.Value + Random
Stats.DogeHunger.Value = Stats.MaxHunger.Value
Stats.DogeHealth.Value = Stats.MaxHealth.Value
Stats.DogeXP.Value = 0
Stats.Speed.Value = Stats.Speed.Value + 0.7
Stats.Level.Value = Stats.Level.Value + 1
if player.Stats.Level.Value == 1 then
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Baby Doge [Level 1]"
Stats.XPNext.Value = Stats.XPNext.Value * 3
elseif player.Stats.Level.Value == 2 then
Offset = Vector3.new(3.5,3.5,3.5)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,0.9,0)
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Doge [Level 2]"
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(1.5,1.5,1.5)
Stats.XPNext.Value = Stats.XPNext.Value * 2
elseif player.Stats.Level.Value == 3 then
Offset = Vector3.new(4,4,4)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(2,2,2)
Stats.XPNext.Value = Stats.XPNext.Value * 2
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Normal Doge [Level 3]"
elseif player.Stats.Level.Value == 4 then
Offset = Vector3.new(4.5,4.5,4.5)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,1.5,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(2.5,2.5,2.5)
Stats.XPNext.Value = Stats.XPNext.Value * 2
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Growing Doge [Level 4]"
Stats.XPNext.Value = Stats.XPNext.Value * 2
elseif player.Stats.Level.Value == 5 then
Offset = Vector3.new(5.5,5.5,5.5)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,2,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(3.5,3.5,3.5)
Stats.XPNext.Value = Stats.XPNext.Value * 4
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Flying Doge [Level 5 (Upgrade 1)]"
elseif player.Stats.Level.Value == 6 then
Offset = Vector3.new(6,6,6)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,2.5,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(4,4,4)
Stats.XPNext.Value = Stats.XPNext.Value * 2
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Faster Doge [Level 6]"
elseif player.Stats.Level.Value == 7 then
Offset = Vector3.new(6.5,6.5,6.5)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,3,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(4.5,4.5,4.5)
Stats.XPNext.Value = Stats.XPNext.Value * 2
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Cool Doge [Level 7]"
elseif player.Stats.Level.Value == 8 then
Offset = Vector3.new(7,7,7)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,3.2,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(5,5,5)
Stats.XPNext.Value = Stats.XPNext.Value * 2
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Powerful Doge [Level 8]"
elseif player.Stats.Level.Value == 9 then
Offset = Vector3.new(7.5,7.5,7.5)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,3.5,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(5.5,5.5,5.5)
Stats.XPNext.Value = Stats.XPNext.Value * 3
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Super Doge [Level 9]"
elseif player.Stats.Level.Value == 10 then
Offset = Vector3.new(8.5,8.5,8.5)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,3.5,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(6.5,6.5,6.5)
Stats.XPNext.Value = Stats.XPNext.Value * 4
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Super Duper Doge [Level 10 (Upgrade 2)]"
elseif player.Stats.Level.Value == 11 then
Offset = Vector3.new(9,9,9)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,4.5,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(7,7,7)
Stats.XPNext.Value = Stats.XPNext.Value * 2
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Extreme Doge [Level 11]"
elseif player.Stats.Level.Value == 12 then
Offset = Vector3.new(9.5,9.5,9.5)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,5.3,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(7.5,7.5,7.5)
Stats.XPNext.Value = Stats.XPNext.Value * 3
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Amazing Doge [Level 12]"
elseif player.Stats.Level.Value == 13 then
Offset = Vector3.new(10,10,10)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,5.8,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(8,8,8)
Stats.XPNext.Value = Stats.XPNext.Value * 3
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s Super Doge [Level 13]"
elseif player.Stats.Level.Value == 14 then
Offset = Vector3.new(11,11,11)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,6.2,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(9,9,9)
Stats.XPNext.Value = Stats.XPNext.Value * 5
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s EPIC Doge [Level 14] (Upgrade 3)"
elseif player.Stats.Level.Value == 15 then
Offset = Vector3.new(13,13,13)
game.workspace[player.Name.."Dog"].ShowName.StudsOffsetWorldSpace = Vector3.new(0,6.7,0)
game.workspace[player.Name.."Dog"].DogeMesh.Scale = Vector3.new(11,11,11)
Stats.XPNext.Value = Stats.XPNext.Value * 6
game.workspace[player.Name.."Dog"].ShowName.txt.Text = player.Name.."'s LEGENDARY Doge [Level 15] (Max Upgrade (4), Max Level)"
end
end
LevelEvent.OnServerEvent:Connect(onLevelFired)
