Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to fix expected string, got boolean?

Asked by 4 years ago
Edited by Ziffixture 4 years ago

This is my script in ServerScriptService:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MainPlate = game.Workspace:WaitForChild("MinePlate")
local Status = Instance.new("BoolValue")

local RoundLength = 50
local Intermissionlength = 5

local InRound = game.ReplicatedStorage:WaitForChild("inround")
local status = game.ServerScriptService:WaitForChild("Status")

local function timer()
    while true do
        for i = Intermissionlength, 1, -1 do 
            InRound.value = false
            wait(1)
            local startintro = Instance.new("BoolValue")
            status.value = "Intermission: "..i.." seconds"
        end
        for i = RoundLength, 1, -1 do 
            status.value = true
            wait(1)
            local startintro = Instance.new("BoolValue")
            status.value = "Game: "..i.." seconds left!"
        end
    end
end

spawn(timer)

In ReplicatedStorage: -Inround (BoolValue) -Status (BoolValue)


In my LocalScript under StarterGui:

local status = game.ReplicatedStorage.Status
local player = game.Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui")
local title = gui.Timer.Title

function UpdateTitle()
    title.Text =  status.value -- Error
end

UpdateTitle()

status.Changed:Connect(UpdateTitle)

In StarterGui : -Timer -localscript -Title

1
BoolValue's cannot bare a string datatype. I suggest modifying "Status" to a StringValue. If you need any more help, contact my discord: Ziffix#0152 Ziffixture 6913 — 4y
0
Tell me if the script continues to run after line 9, and I can fix the problem Nckripted 580 — 4y
0
Server script Nckripted 580 — 4y
0
Try changing the 3rd line of first code to this: ~~~~~~~~~~~~~~~~~ local Status = Instance.new("StringValue") ~~~~~~~~~~~~~~~~~ UfoVR1337 7 — 4y

Answer this question