I made a radar and items picking up system. Basically when you pick up an item the radar gui is not working, but when radar is in Starter Pack its working as it should. Anybody knows how to solve this problem?
Radar Gui script: (local script)
local OtherCamera = Instance.new("Camera", workspace)
OtherCamera.CameraType = "Scriptable"
OtherCamera.FieldOfView = 1
OtherCamera.Name = "RadarCam"
local Player = game.Players.LocalPlayer
local Char = Player.CharacterAdded:Wait()
local Hum = Char:WaitForChild("HumanoidRootPart")
local GamepassId = 16200512
local SoundBeep = script.Parent.Parent.Handle.Beep
local Image = script.Parent:WaitForChild("Radar")
local Viewport = Image:WaitForChild("RadarFrame")
local Monster_Far_Dot = game.ReplicatedStorage:WaitForChild("MonsterFarAway")
local ChangeSoundRemote = game.ReplicatedStorage:WaitForChild("RadarSounds").ChangeSound
Viewport.CurrentCamera = OtherCamera
local RunService = game:GetService("RunService")
local OverMagnitude = 300
RunService.RenderStepped:Connect(function()
Viewport:ClearAllChildren()
for i, plr in pairs(game.Players:GetPlayers()) do
local plrChar = plr.Character
if plrChar and plrChar:FindFirstChild("HumanoidRootPart") then
local Magnitude = (Hum.Position - game.Workspace.Monster.HumanoidRootPart.Position).magnitude
local DoneMagnitude = math.floor(Magnitude)
local PlayerDotThing = game.ReplicatedStorage.CharacterBlock:Clone()
local Position = plrChar.HumanoidRootPart.Position
local MonsterDot = game.ReplicatedStorage.MonsterBlock:Clone()
MonsterDot.Parent = Viewport
PlayerDotThing.Parent = Viewport
MonsterDot.CFrame = CFrame.new(game.Workspace.Monster.HumanoidRootPart.Position)
PlayerDotThing.CFrame = CFrame.new(plrChar.HumanoidRootPart.Position)
OtherCamera.CFrame = CFrame.new(Vector3.new(Position.X, 10000, Position.Z), Position)
if DoneMagnitude >= OverMagnitude then
local MonsterFarcloned = Monster_Far_Dot:Clone()
MonsterFarcloned.Parent = Viewport
MonsterFarcloned.CFrame = CFrame.new(Hum.Position, game.Workspace.Monster.HumanoidRootPart.Position) + Vector3.new(10, 0, 0)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, GamepassId) then
local MonsterFarcloned = Monster_Far_Dot:Clone()
MonsterFarcloned.Parent = Viewport
MonsterFarcloned.CFrame = CFrame.new(Hum.Position, game.Workspace.Monster.HumanoidRootPart.Position) + Vector3.new(10, 0, 0)
end
ChangeSoundRemote:FireServer(1, SoundBeep)
else
if DoneMagnitude <= 300 and DoneMagnitude >=150 then
ChangeSoundRemote:FireServer(3, SoundBeep)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, GamepassId) then
local MonsterFarcloned = Monster_Far_Dot:Clone()
MonsterFarcloned.Parent = Viewport
MonsterFarcloned.CFrame = CFrame.new(Hum.Position, game.Workspace.Monster.HumanoidRootPart.Position) + Vector3.new(10, 0, 0)
end
else
if DoneMagnitude <= 150 and DoneMagnitude >1 then
ChangeSoundRemote:FireServer(5, SoundBeep)
end
end
end
end
end
end)
Item picking up script (normal script in serverscriptservice)
local Remote = game.ReplicatedStorage:WaitForChild("ItemPickUp")
Remote.OnServerEvent:Connect(function(Plr, Item)
local GiveItem = game.ReplicatedStorage:WaitForChild("Items"):FindFirstChild(Item.Name)
local GiveItemCloned = GiveItem:Clone()
GiveItemCloned.Parent = Plr.Backpack
Item:Destroy()
end)
When you press 'E' the item appears in your backpack but the gui doesn't work.
