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

[StarterGui] Local Script are working in studio but not in game, why?

Asked by 6 years ago

This works in studio but not in game, how do I fix this? I have the same script in workspace and it works. This script is placed in startergui.

local http = game:GetService("HttpService")
local Trello = "lI46otVc"
local Key = "secret" -- I removed the key for safety
local Token = "secret" -- I removed the token for safety
local get = http:GetAsync('https://api.trello.com/1/lists/5af9b06b147bcf8c3833dd60/cards/?key='..Key..'&token='..Token,true)
local tab = http:JSONDecode(get)
local de = false

while true do
    for _,h in pairs(tab) do
        if de == true then
            wait(1)
        elseif de == false then
            de = true
            wait(1)
            script.Parent.Text = h.desc
            script.Parent.Parent:TweenPosition(UDim2.new(0.5, -250, 0, 0), 'Out', 'Bounce', 1)
            wait(8)
            script.Parent.Parent:TweenPosition(UDim2.new(0.5, -250, 0, -200), 'Out', 'Bounce', 1)
            wait(1)
            de = false
            wait(20)
        end
    end
end
0
i know the answer to your question RodrigatorOP 172 — 6y
3
Httpservice can only be accessed by serverscripts, you should use remote events User#20388 0 — 6y
0
How do I use remote events? Are you able to help me? GroovyFhish 8 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Depends on what you are trying to use it for. If you're trying to make it access a server file use a FireServer() function

-- LocalScript

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("CreatePartEvent")

createPartEvent:FireServer()

Not my script this was taken from the wiki but can be made by anyone

Ad

Answer this question