Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

3 comments

0

i know the answer to your question

3

Httpservice can only be accessed by serverscripts, you should use remote events

0

How do I use remote events? Are you able to help me?

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.