Hi! I am currently creating a simulator and I have a problem with world boosts, I created two scripts: This is worldboost_client:
local Players = game:GetService("Players") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local WorldBoost = playerGui:WaitForChild("WorldBoost") local WorldBoostLabel = WorldBoost:WaitForChild("WorldBoostLabel") WorldBoostLabel.Text = ("JUMP WORLD BOOST: x")..player.WorldBoost.Value player.WorldBoost.Changed:Connect(function() WorldBoostLabel.Text = ("JUMP WORLD BOOST: x")..player.WorldBoost.Value end)
this is main_worldboost:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local zonePlus = require(ReplicatedStorage.WorldBoosts.Zone) local Worlds = workspace.Worlds local function newPlayer(player) local worldBoost = Instance.new("NumberValue") worldBoost.Name = "WorldBoost" worldBoost.Value = .1 worldBoost.Parent = player for i, world in pairs(Worlds:GetChildren()) do if (not world:IsA("BasePart")) then continue end local zone = zonePlus.new(world) zone.playerEntered:Connect(function(player) player.WorldBoost.Value = world.Boost.Value end) zone.playerExited:Connect(function(player) player.WorldBoost.Value = 0.1 end) end end local function setupWorldBoosts() Players.PlayerAdded:Connect(newPlayer) end
the problem is that when I change worlds, the textlabel that displays the multiplier does not change. I hope that someone could help me! Thanks in advance!