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

Twitter code doesnt give coil after code is typed?

Asked by
Vid_eo 126
8 years ago

This twitter thing works FINE (it says invalid code) but even when i type the CORRECT code it says invalid code.

1ST CODE, A SCRIPT IN WORKSPACE (REMOTE EVENT FIRED)

--1st script (remote event)
local event = game.Workspace:WaitForChild("Wait")
game.Players.PlayerAdded:connect(function(player)
    shared.TwitterStatus = false
    event:FireClient(player)
end)

2ND SCRIPT (LOCAL SCRIPT, IN SUBMIT IN A FRAME (TWITTER))

local RepStorage = game:GetService'ReplicatedStorage'

local Players = game:GetService'Players'


local Remote = workspace:WaitForChild'Wait'

local Gear = RepStorage:WaitForChild'GravityCoil'


local Button = script.Parent
local InputGui = Button.Parent:WaitForChild'Input'

local Client = Players.LocalPlayer
local Backpack = Client:WaitForChild'Backpack'


local Status = false



Remote.OnClientEvent:connect(function(Request, ...)
    Request = tostring(Request):lower()



    if(Request == 'test')then
        Status = not Status
    end
end)


script.Parent.MouseButton1Click:connect(function()
    if (InputGui.Text == 'Yep') and (Status == false) then
        print 'Fired'
        Gear:Clone().Parent = Backpack
        InputGui.Text = ''
        Button.Text = 'Success!'
        wait(1)
        Button.Text = 'Submit'
    else
        InputGui.Text = 'Submit'
    Button.Text = 'Invalid Code'
    wait(1)
    Button.Text = 'Submit'
    end
end)

0
LINE 28, Status = false. You also do not have a line that sets Status to true. TheDeadlyPanther 2460 — 8y
0
Where would I put the status = true part Vid_eo 126 — 8y
0
Line 18, just make it true instead of false. TheDeadlyPanther 2460 — 8y
0
Thanks. Any way you could make it so that the coil only is given once, then it says "Invalid code?" Vid_eo 126 — 8y
0
Have it then fire a remote event to the server, which then saves a datastore holding that they already entered it once. You'll also need a line to check if that datastore exists Shawnyg 4330 — 8y

Answer this question