Ok, I am making a minigame game and how it works is that im trying to activate a camera script when the character teleports to the chosen map. it then gives the value of the map through a stringvalue so the camerascript knows what camera point to go to. But the problem is that is doesnt do anything to the camera and just says “loadstring() is not available” even though i turned it loadstring on. I am new to scripting so i might make stupid mistakes but here is my code:
Part of the minigame script:
ClonedMap.Parent = game.Workspace
status.Value = "Map: "..ClonedMap.Name
MapValue.Value = ClonedMap
task.wait(3)
for i, Player in pairs(game.Players:GetPlayers()) do
local char = Player.Character
if char then
Run = true
local hrp = char.HumanoidRootPart
if Run == true then
end
hrp.CFrame = ClonedMap.Positions.Two.CFrame
CameraClone = game.ReplicatedStorage.CameraScript:Clone()
CameraClone.Parent = Char
for i,v in pairs(game.Players:GetPlayers()) do
Char = v.Character
end
end
Part of the camera script:
local player = game.Players.LocalPlayer
local camera = game.workspace.CurrentCamera
local RunServ = game:GetService("RunService")
player.CharacterAdded:Wait()
HRP = player.Character:WaitForChild("HumanoidRootPart")
local char = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = 50
MapValue = game.ReplicatedStorage.Map -- String Value
while true do
local instance = workspace:FindFirstChild(MapValue.Value)
if instance then
print("works")
camera.CFrame = instance.CameraPoint.CFrame
end
end
