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

Script working fine on Studio but not on Roblox Player. Is there any solution to this?

Asked by 1 year ago

I was making a script builder and when I used the execute button, it errored stating that P is not a valid member of the controller. In Studio, it works fine, but it makes errors on the Roblox Player. I used Studio's play mode, the script type is a local script, and the location is in a proper place (StarterGui).

What I expect is that the script executes just fine depending on the location (Client, server), but it actually errors stating that P is not a valid member of the controller in line 1 with the exception in Studio.

local text = script.Parent.Parent.Content.ServerCode
local ActiveSide = script.Parent.Parent.ActiveSide
local Server = script.Parent.Parent.Server
local Client = script.Parent.Parent.Client
local RelplicatedStorage = game:GetService("ReplicatedStorage")
local loadstringclient = require(RelplicatedStorage.Loadstring)

script.Parent.MouseButton1Click:Connect(function()
    if ActiveSide.Value == Server then
        game:GetService("ReplicatedStorage").ExecuteServer:FireServer(text.ContentText)
    elseif ActiveSide.Value == Client then
        loadstringclient(text.ContentText)()
    end
end)

Answer this question